Incorrect control width after window resize (bootstrap theme only) #1919
Description
Bug description:
After resizing a browser's window, control's width become longer.
Sometimes it's just +20 px and sometimes it's +500px
Link to minimally-working plunker that reproduces the issue:
Simply https://angular-ui.github.io/ui-select/demo-bootstrap.html
Version of Angular, UI-Select, and Bootstrap/Select2/Selectize CSS
Your own demo. Tested on google chrome and firefox.
FIX?
-
Find that code in select.js (lines: ~815-829)
var input = ctrl.searchInput[0], container = ctrl.searchInput.parent().parent()[0], calculateContainerWidth = function() { // Return the container width only if the search input is visible return container.clientWidth * !!input.offsetParent; }, updateIfVisible = function(containerWidth) { if (containerWidth === 0) { return false; } var inputWidth = containerWidth - input.offsetLeft - 10; if (inputWidth < 50) inputWidth = containerWidth; ctrl.searchInput.css('width', inputWidth+'px'); return true; };
-
Change
ctrl.searchInput.css('width', inputWidth+'px');
into
ctrl.searchInput.css('width', '100%');
-
Profit