Skip to content
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

Firefox - Dropdown width - width does not adjust to content #1206

Closed
naitse opened this issue May 9, 2013 · 7 comments
Closed

Firefox - Dropdown width - width does not adjust to content #1206

naitse opened this issue May 9, 2013 · 7 comments

Comments

@naitse
Copy link

naitse commented May 9, 2013

In Chrome tha width of the dropdown is adjusted to the width of the largest child element

this is not happening at Firefox

@stof
Copy link
Collaborator

stof commented May 9, 2013

Are you using the latest version of Chosen or an older one ?

@naitse
Copy link
Author

naitse commented May 10, 2013

// Version 0.9.13

@n00ge
Copy link

n00ge commented May 10, 2013

I'm using 1.9.4 and am running into a problem with the widths in Firefox as well. I have defined a width for the select to be 140px; On Chrome, Safari, and Opera it appears correctly (http://cl.ly/image/0m0P36402m0K)
On Firefox, it appears much smaller (http://cl.ly/image/2H0q1j0z0d0S) It's smaller on IE as well.

It is consistently smaller by 87 pixels on each of the dropdowns. I'm still trying to dig in further to see if I can figure out more.

It does, however, size the dropdowns correctly on hidden tabs. Just not on views that are visible initially.

@doits
Copy link

doits commented May 13, 2013

same issue for me in firefox. width is too small, see fiddle. using it with jquery.

to fix the issue, simply do not use window.getComputedStyle here but change to:

width = if jQuery? and @form_field_jq?
  @form_field_jq.outerWidth()
else
  @form_field.getWidth()

but cannot say if this affects other browsers, only tested in ff.

@n00ge
Copy link

n00ge commented May 13, 2013

I tested @doits update on the latest versions of Safari, Opera, and Chrome. Also in IE8, IE9, and IE10. All of these appear to be working properly when chosen is drawn on a select initially visible on screen as well as when it's in a hidden tab.

@doits, I'd suggest adding in a pull request with your changes.

@pfiller
Copy link
Contributor

pfiller commented May 13, 2013

@naitse I believe this is a duplicate of #202 which is fixed by #1172. Can you confirm that pulling the branch from #1172 fixes this issue for you?

@pfiller
Copy link
Contributor

pfiller commented May 14, 2013

#1172 landed in master. If this doesn't fix the issue, please provide a fiddle demonstrating the problem so we can re-open.

@pfiller pfiller closed this as completed May 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants