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

Tagging token "ENTER" does not work in single mode #1173

Open
WrongDog opened this issue Sep 1, 2015 · 7 comments
Open

Tagging token "ENTER" does not work in single mode #1173

WrongDog opened this issue Sep 1, 2015 · 7 comments

Comments

@WrongDog
Copy link

WrongDog commented Sep 1, 2015

This issue can be produced in demo-tagging. When you input something which does not exists in the last "Tagging without multiple, with simple strings" no tagging label will be displayed and when you hit "ENTER" the input got cleared and model value is empty.

In "uiSelectCtrl" ctrl.searchInput 'keydown' event handle logic _handleDropDownSelection(key) is executed before new tagging item could be added and for "ENTER" since no item is selected _handleDropDownSelection will clear search input so no new tagging item. But other token like ',' can work although still new tagging item shows in search result.

@alliance-koles
Copy link

+1

@kshutkin
Copy link
Contributor

kshutkin commented Sep 1, 2015

Please check this #972

@qwiglydee
Copy link

Is it still open in 0.17?

@ghost
Copy link

ghost commented Jun 9, 2016

It is still open in 0.17.1: http://plnkr.co/edit/4qVRxMQrSmxsTLf4piYp?p=preview

When keydown triggered by ENTER or TAB key, it seems to be that $select.search string is deleted before tagging finishes.

@ghost
Copy link

ghost commented Sep 14, 2016

keydown calls _handleDropDownSelection() before checking whether pressed key is a tagging token.
But _handleDropDownSelection() calls ctrl.select() because it does not know that pressed ENTER/TAB key is a tagging token.
Then ctrl.select() is processed, ctrl.search is cleared, and tagging aborts.

Adding a parameter such as isTaggingToken to _handleDropDownSelection() will solve this issue easily. But it seems to be an ad-hoc parameter, too.

@anatolykhelmer
Copy link

+1

1 similar comment
@GregoirePiat
Copy link

+1

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

7 participants