Select 2 Dropdown width

871 views
Skip to first unread message

ian.cl...@gmail.com

unread,
Apr 23, 2013, 5:11:47 AM4/23/13
to sel...@googlegroups.com
Hi Igor,

I really like Select2, your documentation and the API in particular are really great. I'm wondering whether or not you've considered looking at adding a feature that allows you to have a container and a dropdown of different widths. I'm looking to convert a number of selects using this, but whilst the selects themselves are small, the options dropdowns are as wide as needs be. Obviously I could just override this behaviour using CSS (and I will probably do this for now) - but the current styling doesn't really suit this kind of design currently.

Really I just wanted to point out that you may have situations where you have _really_ long options, but you don't want to have a _really_ long container.

Thanks,
Ian

Igor Vaynberg

unread,
Apr 23, 2013, 11:50:51 AM4/23/13
to sel...@googlegroups.com
you can set the dropdown width to something other than the container's
using dropdownCss option. in the master branch there is also a new
dropdownAutoWidth option.

-igor
> --
> You received this message because you are subscribed to the Google Groups "select2" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
> To post to this group, send email to sel...@googlegroups.com.
> Visit this group at http://groups.google.com/group/select2?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Message has been deleted

ian.cl...@gmail.com

unread,
Apr 24, 2013, 11:13:47 AM4/24/13
to sel...@googlegroups.com
Hi Igor,
Thanks for the quick reply - yes I went with the dropdownCss option in the first place, but you still need to use the !important flag to override the inline width. The dropdownAutoWidth is exactly what I'm looking for, though I think for now I'll wait until it's in the stable release. Thanks :)

Toni Kroos

unread,
11:39 AM (8 hours ago) 11:39 AM
to select2
Unsent Messages lets you express thoughts you never delivered, giving you a space to release emotions safely. It helps you organize feelings, reflect on conversations, and find closure without sending anything. Perfect for journaling or emotional clarity, Unsent Messages turns unspoken words into personal healing.
Reply all
Reply to author
Forward
0 new messages