ui-select
ui-select copied to clipboard
search-enabled=false breaks keyboard interaction on Safari
Bug description:
Steps to reproduce
- Set
search-enabled=false - Use desktop Safari (tested on 10.1.1)
- Click/tab/focus on the ui-select element
- Use up/down arrow keys to change what is selected.
Expected
- Can change what is selected when dropdown is open
- Can open dropdown when dropdown is closed
Actual
- Cannot change what is selected
- Dropdown panel quickly opens and closes.
Link to minimally-working plunker that reproduces the issue:
http://angular-ui.github.io/ui-select/demo-disable-search.html
Version of Angular, UI-Select, and Bootstrap/Select2/Selectize CSS
UI-Select
Angular: ^1.4
UI-Select: 0.19.8
Bootstrap/Select2/Selectize CSS (if applicable): All
I'm not sure this is limited to Safari.
Also, it looks like this has been a long standing issue. I've found more than one issue that revolves around search-enabled=false and keyboard interaction being unreliable.
#375 was the issue I found that was supposedly fixed in PR #1717
I am using Angular v1.4.4 with ui-select v0.19.7 (updated from v0.11.1 hoping that would fix my issue)
Cannot use keyboard to shortcut to items in the list in Chrome or FF (other browsers untested).
I try this one but I cannot reproduce it. (with angular 1.4.4 tested and latest ui-select) Attempt 1:
- Disabled search
- tab to next ui-select
- enter to open select
- pressed a couple of times on up/down keys
- enter to select a item
- tabbed to the next ui-select
Attempt 2:
- Disabled search
- tab to next ui-select
- pressed down to open select
- pressed a couple of times on up/down keys
- enter to select a item
- tabbed to the next ui-select
Probably i'm doing something wrong though 😃
@Jefiozie What about using character navigation? Intuition leads me to believe pressing "T" should take you to the first item in the list that starts with "T".
Ah that is what I was missing now I see what you mean.
If search-enabled=false and you press a key for example: A it should select the first item in the list with the A correct?
If search-enabled=false and you press a key for example: A it should select the first item in the list with the A correct?
@Jefiozie That is correct. I'm unfamiliar with the code for this plugin, but let me know if there's anything I can do to get some momentum on getting this solved.
While testing in chrome, the keyboard navigation works with this fix, but a weird search box has started to appear even when search-enabled is set to false. Also the size of search box (when search-enabled is true) is larger than what is used to be..

same issue. not totally sure about the whole code. but after putting some breakpoints around, I finally figured that this lime is closing the dropdown again in uiSelectController.js's ctrl.activate function at line 167
else if (ctrl.open && !ctrl.searchEnabled) { // Close the selection if we don't have search enabled, and we click on the select again ctrl.close(); }
this is being called from ctrl.toggle($event) from template at
<i class="caret pull-right" ng-click="$select.toggle($event)" role="button" tabindex="0"></i>