Set min-width on select2 element

Created on 17 December 2019, almost 5 years ago
Updated 5 May 2023, over 1 year ago

After fixing #3003459: Implement size widget setting users got to configure the size of the widget, but the problem with that is that sets a fixed with for the field. Using percentages is fine, but if you use a fixed with e.g. 100px or you use the other supported values to let automatically calculate the width it would set a fixed width always and that breaks the responsiveness of the page.
Which is I guess fine when you specifically want a fixed width, but there's no way now AFAIK to set a responsive width other then fiddling around with arbitrary %s.

Not having a min-width shows a problem, when select2 can't figure out the width of the field e.g. setting the width to style and not having one or setting it to auto, which would be a correct CSS value, but it doesn't really work here. So in these cases the field is really small, when it doesn't have a value yet.

🐛 Bug report
Status

Active

Version

1.0

Component

Field widgets

Created by

🇷🇸Serbia arpad.rozsa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇷France mably

    Same problem here with claro admin theme.

    A width of 0.75em is applied directly on the element and so the select content is unreadable.

Production build 0.71.5 2024