You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in the options of chosen, when you instantiate chosen on a hidden select field, the chosen select box width is 0 unless you define a width in the JS call.
This can be fixed by changing line 559 in chosen.jquery.js from return this.form_field.offsetWidth to window.getComputedStyle(this.form_field, null).width. This will return the value 150px when width: 150px is set on the original select field in CSS.
This is a much more robust solution that allows for easier customization of widths through CSS rather than needing multiple JS calls for each hidden select field that has a different width.
The text was updated successfully, but these errors were encountered:
Pretty sure this is a duplicate of the long-standing #92. Please feel free to leave any additional feedback you have there. There's also a number of workarounds offered up on that issue.
As mentioned in the options of chosen, when you instantiate chosen on a hidden select field, the chosen select box width is 0 unless you define a width in the JS call.
This can be fixed by changing line 559 in chosen.jquery.js from
return this.form_field.offsetWidth
towindow.getComputedStyle(this.form_field, null).width
. This will return the value150px
whenwidth: 150px
is set on the original select field in CSS.This is a much more robust solution that allows for easier customization of widths through CSS rather than needing multiple JS calls for each hidden select field that has a different width.
The text was updated successfully, but these errors were encountered: