-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
container_width = 0px #2795
Comments
I have a similar issue with the container width being set to width=0px; in the style attribute. |
Hi, have similar issue: Seems this issue is appears when chosen initialized before parent container is hidden. Also according to (Mozilla https://developer.mozilla.org/docs/Web/API/HTMLElement/offsetWidth) this property is not working properly also with "position : fixed". I see few workarounds:
|
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. |
Hi, I'm using a very old template (janux) for a system I've. that template used 0.98 version of chosen, and the .trigger("chosen:updated") did not work,
I tried updating to latest version but it only show a very tiny button, so, after some research and debug I found out that AbstractChosen.prototype.container_width was returning 0px (zero)
To fix in my hurry to get it fixed I just did the following:
AbstractChosen.prototype.container_width = function() {
toReturn = "";
if (this.options.width != null) {
toReturn = this.options.width;
} else {
toReturn = "" + this.form_field.offsetWidth + "px";
}
if (toReturn=="" || toReturn=="0px")
toReturn = "150px";
return toReturn;
};
This fixed the tiny button problem displaying the select correctly and with the latest version .trigger("chosen:updated") work like a charm.
I hope you can find a most professional solution for the container_width issue. Thank you
NOTE: The chosen select I'm using is inside a modal window, maybe this helps,
Thank you in advance for your help
Gustavo Arcila
The text was updated successfully, but these errors were encountered: