From 0d814931d834f9db51293b38f71076beb5d15620 Mon Sep 17 00:00:00 2001 From: nabilnaffar Date: Wed, 19 Oct 2016 22:24:40 +0300 Subject: [PATCH] Bug fix - Search input isn't blocked (#1822) * 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 ffcf66c9b8915f75225ae66b4345f87672321363. * 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. --- src/uiSelectController.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/uiSelectController.js b/src/uiSelectController.js index 6bb257bd9..1123e9946 100644 --- a/src/uiSelectController.js +++ b/src/uiSelectController.js @@ -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 @@ -645,6 +645,9 @@ uis.controller('uiSelectCtrl', }); } } + }else{ + e.preventDefault(); + e.stopPropagation(); } });