Select2 Form Field w/ Shorter Width #223
Unanswered
eddysanoli
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @eddysanoli, Thanks for reaching out. However, I would suggest reading into the Select2 docs and reaching out to their community. This package is merely the Django integration of their amazing frontend package. Cheers! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goal
Im trying to create a field in a django form using django-select2 and the data from a model. The field works as expected, but it doesn't look how I want it. See the setup in the code snippet section.
Problem
The problem is that the field tries to deliberately fit just the side of the data inside. So if no data is present, even if the width of its container is half the page, the field will squish to the lowest possible width that accomodates the "Select an API operation" placeholder text. I would like for the input to span the width of its parent. Is there a setting for this?
I also saw that when you inspect the CSS of the Select2 input, its generating an inline style that actually sets a lower width for the input. Im pretty sure this should be a setting, but maybe its something that I need to enable through Javascript
Code Snippet
Beta Was this translation helpful? Give feedback.
All reactions