Skip to content

Commit 4184fa7

Browse files
committed
fix(searchEnabled): Prevent searching when disabled
Previously, even when search-enabled was set to false, users could still type in text and filter the list. This made disabling the search feature pointless. This fix prevents text entry to the search input and thus disables filtering. Fixes angular-ui#1658
1 parent 5691f58 commit 4184fa7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/uiSelectController.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,10 @@ uis.controller('uiSelectCtrl',
613613
var tagged = false;
614614

615615
if (ctrl.items.length > 0 || ctrl.tagging.isActivated) {
616-
_handleDropDownSelection(key);
616+
if(!_handleDropDownSelection(key) && !ctrl.searchEnabled) {
617+
e.preventDefault();
618+
e.stopPropagation();
619+
}
617620
if ( ctrl.taggingTokens.isActivated ) {
618621
for (var i = 0; i < ctrl.taggingTokens.tokens.length; i++) {
619622
if ( ctrl.taggingTokens.tokens[i] === KEY.MAP[e.keyCode] ) {

0 commit comments

Comments
 (0)