ui-select icon indicating copy to clipboard operation
ui-select copied to clipboard

Input Width not 100%

Open erslater opened this issue 10 years ago • 42 comments
trafficstars

I have a multi select inside a bootstrap tab page and the search input is only 10px wide when it first displays.

beforefocus

After clicking on the tab that the multi select appears on the width will expand to 100% once focus is placed on any of the controls in the form.

afterfocus

erslater avatar Dec 18 '14 20:12 erslater

Same symptoms here, anything happened since then ?

PowerKiKi avatar Dec 22 '14 08:12 PowerKiKi

@erslater, could you provide demo?

havenchyk avatar Jan 10 '15 12:01 havenchyk

Here is a Plunker updated to latest versions of everything and demonstrating the issue: http://plnkr.co/edit/f6o1hxq1Yymc7Vv2oMHb?p=preview

As you can see removing ngAnimate avoid the issue. Unfortunately this is probably not an acceptable solution for real-world cases.

PowerKiKi avatar Jan 22 '15 02:01 PowerKiKi

Having the same issue here....

For now, in my scenario, was able to hack around the problem by tweaking the positioning of related elements. Of course the ui-select-container needs a height...

  .select2-choices {
    position: relative;
  }
  .ui-select-multiple input.ui-select-search {
    width: 100% !important;
    position: absolute;
  }

rywhee avatar Feb 19 '15 23:02 rywhee

i have the same issue. Small hack from rwhee solved problem for me (for now..)

TroodoNmike avatar May 09 '15 21:05 TroodoNmike

Same isssue. But my workaround is:

.ui-select-multiple input.ui-select-search:not(.ng-touched) {
    width: 100% !important;
}

ma-zal avatar Jun 29 '15 16:06 ma-zal

This solution not working when we have short select and long text selected because we don't have space to click and add another item.

I prefer to add width: inherit !important and add plus icon for input

macem avatar Jul 22 '15 11:07 macem

Same problem here, but for now @macem's solution works

silentHoo avatar Aug 06 '15 07:08 silentHoo

Same problem here.

arbaaz avatar Aug 11 '15 06:08 arbaaz

Possible duplicate of #1111

cdjackson avatar Aug 11 '15 16:08 cdjackson

I ran into the same problem while using ui-select inside of a table, inside of angular-ui's Bootstrap tabs. Fixed it by adding a select="tabSelected()" callback to the tab element with $scope.tabSelected = function() { $scope.$applyAsync(); }; in the controller.

jziggas avatar Oct 28 '15 18:10 jziggas

Similar to @rywhee I ended up with a CSS based solution. Mine is a little different due to what I assume to be difference in attr/class naming with different ui-select versions.

I am using ui-select 0.13.2 together with Bootstrap 3's modal.

I included a ".modal" to limit this 'fix' to only ui-select's within a bootstrap modal window.

I also included a min height for ui-select-multiple as due to absolute setting on child (ui-select-search) it had no height.

.modal .ui-select-multiple.ui-select-bootstrap {
  position: relative;
  min-height:29px;
}
.modal .ui-select-multiple input.ui-select-search {
  width: 100% !important;
  position: absolute;
}

colinbes avatar Nov 20 '15 18:11 colinbes

+1 for @ma-zal's solution. Thank you

Mobiletainment avatar Dec 16 '15 15:12 Mobiletainment

why this is still a bug?

ilaipi avatar Jan 12 '16 07:01 ilaipi

+1 on Version 0.14.0

verjik avatar Jan 27 '16 14:01 verjik

+1 for @ma-zal

fatihkizmaz avatar Feb 04 '16 12:02 fatihkizmaz

+1 on 0.14.2

bestconsultant avatar Feb 07 '16 18:02 bestconsultant

+1

hitigon avatar Feb 09 '16 22:02 hitigon

+1 on 0.14.9

benitezhm avatar Mar 02 '16 21:03 benitezhm

The width is broken, for me it is always 100%.

sergonius avatar Mar 15 '16 09:03 sergonius

I experience the same error both with @PowerKiKi's plunker, where the input size in Tab 2 is always 10px until it been focused.

I experience the same problem using the current (fe0c0c12522d48d677fff8ca21d366ba37d8f90d) master version of ui-select.

mtr avatar Apr 12 '16 21:04 mtr

+1 to @mtr If you put ui-select inside not active tab, the input.ui-select-search starts with width:10px; inline until it been focused. (tested at 0.16.1)

txtbits avatar Apr 26 '16 06:04 txtbits

Same bug, but this works fine to me:

.form-group .ui-select-container .select2-choices .select2-search-field, .form-group .ui-select-container .select2-choices .select2-search-field input{width:100%!important;}

ronaldohoch avatar May 04 '16 20:05 ronaldohoch

I have the same problem. When I resize the browser the width of ui select changed to 10px. The following works for me.

input.ui-select-search { width: 100% !important; }

yang-zhang-syd avatar May 22 '16 11:05 yang-zhang-syd

+1 - version 0.17.1

madmis avatar Jun 02 '16 07:06 madmis

+1 style="width: 10px;" for some reason

tikijian avatar Jun 02 '16 19:06 tikijian

+1 on 0.17.1

jkevingutierrez avatar Jun 09 '16 20:06 jkevingutierrez

+1 0.17.1 I have 3 multiple select fields. The 3rd one is disabled until the 1st one is filled in. Bars 1 and 2 have 100% width as expected, but when bar 3 becomes enabled the width is 10px.

hcape avatar Jun 09 '16 22:06 hcape

+1 0.17.1

fruzsii avatar Jun 10 '16 08:06 fruzsii

~~This sounds like a duplicate of #1617 (and probably others) which was fixed in the latest commit in dist; it's effectively version 0.17.2, but the version number wasn't bumped - check the date element. The version I'm using is:~~ Version: 0.17.1 - 2016-06-09T20:41:58.363Z as of https://github.com/angular-ui/ui-select/commit/7ab5f175421e8d263e4e6c5eb38a215b4c515c42

I've just tried this, updating the plunkr above, but it's still not working, so appears to be a different issue. Sorry for the confusion!

Jevonius avatar Jun 15 '16 14:06 Jevonius