select2 / select2-bootstrap-theme

A Select2 v4 Theme for Bootstrap 3
https://select2.github.io/select2-bootstrap-theme/
MIT License
872 stars 499 forks source link

Placeholder beeing cut off? #77

Open WalhallaS2 opened 6 years ago

WalhallaS2 commented 6 years ago

Hello,

I stumbled on an issue during a project build-up. The placeholder on a multiselect is beeing cut off. Please have a look on the following screenshot:

select2bs

To reproduce this easily, I did create the following JSFiddle: https://jsfiddle.net/f2gxy3sk/

Please have a look.

Thank you!

caohanh1502 commented 6 years ago

Hi. I think this is a known issue since 2012 when select2 with multiselect is initialized inside a hidden element. Here's a pull request but still not in master yet: https://github.com/select2/select2/pull/4898 There's also a temporary way to fix it using css:

.select2-container .select2-selection.select2-selection--multiple .select2-search.select2-search--inline .select2-search__field:not([placeholder='']) { width: 100% !important; margin-right: 100000px; }

xander-mu commented 6 years ago

.select2-container .select2-selectionrendered > *:first-child.select2-search--inline { width: 100% !important; } .select2-container .select2-selectionrendered > *:first-child.select2-search--inline .select2-search__field { width: 100% !important; }

phaelmoraes commented 5 years ago

I used that way: https://github.com/select2/select2/issues/4323#issuecomment-223440515