From f048ee4c69a9af53d6a6ec33a75b51434d837a80 Mon Sep 17 00:00:00 2001 From: swatijadhav Date: Fri, 18 May 2018 09:30:45 +0530 Subject: [PATCH] fix (IE): Fixed creation of new tag in IE-11 and autocomplate for newly created tag. IE was having issue with keyup event, as sometimes it lost input changes. Due to this, sometimes it creates empty tag. Update select.js, Delayed tag-choices formation on 'keyup' event by few milliseconds --- dist/select.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/select.js b/dist/select.js index 5ac4e0b70..497258684 100644 --- a/dist/select.js +++ b/dist/select.js @@ -1530,7 +1530,7 @@ uis.directive('uiSelectMatch', ['uiSelectConfig', function(uiSelectConfig) { } }]); -uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelectMinErr, $timeout) { +uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', '$$uisDebounce', function(uiSelectMinErr, $timeout, $$uisDebounce) { return { restrict: 'EA', require: ['^uiSelect', '^ngModel'], @@ -1817,7 +1817,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec return true; } - $select.searchInput.on('keyup', function(e) { + var setTagChoices = $$uisDebounce(function(e) { if ( ! KEY.isVerticalMovement(e.which) ) { scope.$evalAsync( function () { @@ -1941,7 +1941,10 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec } }); } - }); + }, 300); + + $select.searchInput.on('keyup focus', setTagChoices); + function _findCaseInsensitiveDupe(arr) { if ( arr === undefined || $select.search === undefined ) { return false;