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

Incorrect control width after window resize (bootstrap theme only) #1919

Open
@Zaczero

Description

@Zaczero

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?

  1. 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; };

  2. Change
    ctrl.searchInput.css('width', inputWidth+'px');
    into
    ctrl.searchInput.css('width', '100%');

  3. Profit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions