ui-select
ui-select copied to clipboard
Tagging token "ENTER" does not work in single mode
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.
+1
Please check this https://github.com/angular-ui/ui-select/pull/972
Is it still open in 0.17?
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.
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.
+1
+1