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; 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 () {