-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple select and/with input group #53
Comments
It works but it also cuts placeholder text and removes placeholder padding... |
This is exactly why I made the decision to have the fields on a separate line to the tags. It caused a lot of issues and was simpler, more effective and didn't break the layout as much having it on a separate line. I'll keep this open to see what people think but I'm inclined to keep the field on a separate line to the tags |
This fix with jQuery still solves the problem with the placeholder. CSS /*fix: multiple select*/
.select2-selection--multiple {
padding: 0rem 0.75rem !important;
}
.select2-selection--multiple > ul {
display: inline-flex !important;
}
.select2-selection--multiple > ul > li {
padding: 0 0.3rem !important;
margin: 0.3rem !important;
}
.select2-selection--multiple .select2-search--inline {
display: inline-flex !important;
width: auto !important;
margin-top: 0.3rem !important;
vertical-align: middle;
} JavaScript / jQuery $('select[multiple]').on('select2:select select2:unselect change', function () {
$(this).next().find('.select2-selection--multiple')
.attr('style', ('padding: ' + ($(this).val().length ? 0 : '0rem 0.75rem') + '!important'));
}); Thanks for your help guys 👍 |
Hello to all, I am here because I noticed the extra line and to be honest I find it unnecessary. I do not use placeholders. @wselen and @ceab254's workaround works fine as long as you only use one line. With two lines, unfortunately not. But thanks anyway. Update:
|
Thanks to everyone contributing to this helpful discussion. The new default layout has two rows - one for the currently Two alternatives have been developed by the participants The patch by @berndy2001 involves just a few lines of css The patch by @wselen, improved by @ceab254, is a combination @apalfrey : Working with the integrated items/input row feels |
I implemented solution from @ceab254 and @wselen and it worked perfectly, thanks for the summary and thank you @ceab254 and @wselen for the astounding work. |
Using multiple select the input box is too high compared to others because the search inline is on the next line.
Would be nice if this would work like bootstrap 3, inline next too tags.
With these adjustment I could fix it for now :
// fix: input-group
// fix: multiple select
.select2-selection--multiple {
padding: 0 !important;
}
.select2-selection--multiple > ul {
display: inline-flex !important;
}
.select2-selection--multiple > ul > li {
padding: 0 0.3rem !important;
margin: 0.3rem !important;
}
.select2-selection--multiple .select2-search--inline {
display: inline-flex !important;
width: auto !important;
margin-top: 0.3rem !important;
vertical-align: middle;
}
The text was updated successfully, but these errors were encountered: