Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow a way to not have the width attribute set inline on the chosen element #2575

Open
stringbeans opened this issue Mar 18, 2016 · 2 comments
Labels

Comments

@stringbeans
Copy link

The width attribute is always set inline on the chosen element and this causes issues around styling and forcing styles to use !important.

It would be nice if there was a way to turn off the default behaviour of setting the width inline so that we can properly style the chosen element width with css

@pfiller
Copy link
Contributor

pfiller commented Jun 2, 2016

I think this is probably something we should take a look at, particularly since CSP and inline styles don't play nicely (#2423).

@tadwohlrapp
Copy link

I had the same issue, fixed it this way:

$('.my_select').chosen({
  options
}).next('.chosen-container').css('width', '');

It simply looks for the .chosen-container following your select-element and removes its inline css.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants