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

Search fails to register keypresses with combo box closed

Open softdevca opened this issue 8 years ago • 5 comments

If the user tabs into a closed ui-select combo box and types quickly the keypresses may not register. The behavior gets worse the longer the list, though it doesn't take many items for the behavior to become consistent.

For example, the attached plunkr is the Basic example from the ui-select home page with $scope.people modified to be significantly longer. To replicate the issue place the cursor in the "Enter an address" field, press Tab then type "adr" quickly and notice the d and r often do not register.

It appears under the hood ui-select is reverting the search string. Debugging in the propsFilter shows it will search for "a" then "ad" then "adr" then "a" again.

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/VBPQvQdsQ7bNUymNHLwp?p=preview

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

Directly from the Basic demo plunkr

Angular: 1.5.0

UI-Select: 0.19.5

softdevca avatar Mar 06 '17 21:03 softdevca

Can you tell me it this is for all themes of the ui-select?

Jefiozie avatar Mar 07 '17 07:03 Jefiozie

Yes, it affects all themes.

softdevca avatar Mar 07 '17 22:03 softdevca

Here is some additional information that will hopefully expedite a fix. When the combo is closed (tab into it) and a key is pressed it is handled by

focusser.bind("keyup input", function(e){...}

If the rest of the search is typed slowly then all of the key inputs are received by

ctrl.searchInput.on('keydown', function(e) {...})

but if the rest is typed quickly the keydown handler is never called and $watch on $select.search is never triggered.

softdevca avatar Apr 06 '17 23:04 softdevca

+1

emmanueldaher avatar Aug 03 '17 14:08 emmanueldaher

I have huge issues with this as well. Many people complain that their characters get eaten away when typing when the dropdown is closed. So if anyone has some kind of workaround that I could implement to solve it, let me know. It is especially frustrating because this dropdown is used in a form that gets used very frequently, and thus efficiency is quite important. The form it is based in is also completely tab optimized to reduce the total number of keypresses needed.

mgmverburg avatar Oct 12 '18 12:10 mgmverburg