ui-select icon indicating copy to clipboard operation
ui-select copied to clipboard

Tagging token "ENTER" does not work in single mode

Open WrongDog opened this issue 9 years ago • 7 comments

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.

WrongDog avatar Sep 01 '15 04:09 WrongDog

+1

alliance-koles avatar Sep 01 '15 12:09 alliance-koles

Please check this https://github.com/angular-ui/ui-select/pull/972

kshutkin avatar Sep 01 '15 14:09 kshutkin

Is it still open in 0.17?

qwiglydee avatar May 30 '16 07:05 qwiglydee

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 avatar Jun 09 '16 14:06 ghost

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.

ghost avatar Sep 14 '16 07:09 ghost

+1

anatolykhelmer avatar Oct 14 '17 17:10 anatolykhelmer

+1

GregoirePiat avatar May 24 '18 10:05 GregoirePiat