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

Commit 06bbd31

Browse files
jintoppywesleycho
authored andcommitted
fix: ensure highlighted before selecting on tab
- Ensure at least one item is highlighted before selecting on tab keypress Closes #1030
1 parent 331f819 commit 06bbd31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/uiSelectController.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,9 @@ uis.controller('uiSelectCtrl',
498498
else if (ctrl.activeIndex > 0 || (ctrl.search.length === 0 && ctrl.tagging.isActivated && ctrl.activeIndex > -1)) { ctrl.activeIndex--; }
499499
break;
500500
case KEY.TAB:
501-
if (!ctrl.multiple || ctrl.open) ctrl.select(ctrl.items[ctrl.activeIndex], true);
501+
if ((!ctrl.multiple || ctrl.open) && ctrl.activeIndex >=0) {
502+
ctrl.select(ctrl.items[ctrl.activeIndex], true);
503+
}
502504
break;
503505
case KEY.ENTER:
504506
if(ctrl.open && (ctrl.tagging.isActivated || ctrl.activeIndex >= 0)){

0 commit comments

Comments
 (0)