Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Null tag added to array #1911

Open
geoffreyvd opened this issue Feb 14, 2017 · 4 comments
Open

Null tag added to array #1911

geoffreyvd opened this issue Feb 14, 2017 · 4 comments

Comments

@geoffreyvd
Copy link

Bug description:

When you have selected the first value in a tag choice dropdown, while the input box is empty and than use the up arrow and hit "enter" there will be a null value added to the array.
Full story: insert any letter: "k" than a dropdown with suggested tags will be represented. Now hit "backspace" and hit "the up-arrow-key" and hit "enter".
A null tag is added
image

Link to minimally-working plunker that reproduces the issue:

The select/tagging demo from the wiki: http://plnkr.co/edit/v5S1ILJXamIBc83WIMMJ?p=preview

Version of Angular, UI-Select, and Bootstrap/Select2/Selectize CSS

Angular:
1.5
UI-Select:
1.9.5

@geoffreyvd geoffreyvd changed the title Null vale returned Null tag added to array Feb 14, 2017
@geoffreyvd
Copy link
Author

geoffreyvd commented Feb 14, 2017

I fixed the bug simply by changing line 689 from select.js in the provided plunkr by changing:
if ( ctrl.activeIndex === 0 ) {
to:
if ( ctrl.activeIndex < 1 ) {

@Jefiozie
Copy link
Contributor

Could you make a pr for this thanks? Also can you verify if this is the same problem (root cause) of #1887
Thanks.

@geoffreyvd
Copy link
Author

Yes, I tested it and it solved it. Will make a pull request soon.

@joaopgg
Copy link

joaopgg commented Apr 19, 2017

Hi guys, any updates on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants