From 5bf25fc51584cfe0ec2d2eb27830ee6a21e3ab9a Mon Sep 17 00:00:00 2001 From: Dmitry Krekota Date: Sat, 31 Mar 2018 02:34:22 +0300 Subject: [PATCH 1/2] Fix #2119 issue --- src/uiSelectController.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/uiSelectController.js b/src/uiSelectController.js index 0929265e4..43f3a80ab 100644 --- a/src/uiSelectController.js +++ b/src/uiSelectController.js @@ -547,6 +547,9 @@ uis.controller('uiSelectCtrl', return false; } var inputWidth = containerWidth - input.offsetLeft; + if (ctrl.multiple) { + inputWidth -= 10; + } if (inputWidth < 50) inputWidth = containerWidth; ctrl.searchInput.css('width', inputWidth+'px'); return true; From 5838e096344b55d767559d5eb3ce2a91c04fce06 Mon Sep 17 00:00:00 2001 From: Dmitry Krekota Date: Sat, 31 Mar 2018 03:02:35 +0300 Subject: [PATCH 2/2] Fix tests --- test/select.spec.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/select.spec.js b/test/select.spec.js index 15cfdb1d2..61cd9fa41 100644 --- a/test/select.spec.js +++ b/test/select.spec.js @@ -2080,8 +2080,7 @@ describe('ui-select tests', function () { var newWidth = searchInput[0].clientWidth + searchInput[0].offsetLeft; var containerWidth = el[0].clientWidth; - expect(containerWidth - newWidth).toBeLessThan(10); - + expect(containerWidth - newWidth).toBeLessThan(15); }); it('should move to last match when pressing BACKSPACE key from search', function () {