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

Commit

Permalink
fix(searchEnabled): Prevent searching when disabled
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
user378230 committed Jul 10, 2016
1 parent 5691f58 commit 8c81552
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/uiSelectController.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,10 @@ uis.controller('uiSelectCtrl',
var tagged = false;

if (ctrl.items.length > 0 || ctrl.tagging.isActivated) {
_handleDropDownSelection(key);
if(!_handleDropDownSelection(key) && !ctrl.searchEnabled) {
e.preventDefault();
e.stopPropagation();
}
if ( ctrl.taggingTokens.isActivated ) {
for (var i = 0; i < ctrl.taggingTokens.tokens.length; i++) {
if ( ctrl.taggingTokens.tokens[i] === KEY.MAP[e.keyCode] ) {
Expand Down

0 comments on commit 8c81552

Please sign in to comment.