Skip to content

Commit

Permalink
Bug fix - Search input isn't blocked (angular-ui#1822)
Browse files Browse the repository at this point in the history
* fixed a bug: User input keys to search input isn't blocked when search-enabled is set to false and all items are selected in multiple select mode.

* Revert "fixed a bug: User input keys to search input isn't blocked when search-enabled is set to false and all items are selected in multiple select mode."

This reverts commit ffcf66c.

* fixed a bug: User input keys to search input isn't blocked when search-enabled is set to false and all items are selected in multiple select mode.
  • Loading branch information
nabilnaffar authored and aaronroberson committed Oct 19, 2016
1 parent 10a60fa commit 0d81493
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 @@ -383,7 +383,7 @@ uis.controller('uiSelectCtrl',
ctrl.select = function(item, skipFocusser, $event) {
if (item === undefined || !_isItemDisabled(item)) {

if ( ! ctrl.items && ! ctrl.search && ! ctrl.tagging.isActivated) return;
if ( (!ctrl.items || !ctrl.items.length) && ! ctrl.search && ! ctrl.tagging.isActivated) return;

if (!item || !_isItemDisabled(item)) {
// if click is made on existing item, prevent from tagging, ctrl.search does not matter
Expand Down Expand Up @@ -645,6 +645,9 @@ uis.controller('uiSelectCtrl',
});
}
}
}else{
e.preventDefault();
e.stopPropagation();
}

});
Expand Down

0 comments on commit 0d81493

Please # to comment.