Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Fix #2119 issue #2122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/uiSelectController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions test/select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down