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

Selectize throws error in Firefox if in an iframe with display:none #520

Closed
wch opened this issue Jul 24, 2014 · 0 comments
Closed

Selectize throws error in Firefox if in an iframe with display:none #520

wch opened this issue Jul 24, 2014 · 0 comments

Comments

@wch
Copy link

wch commented Jul 24, 2014

When selectize is used in an iframe with display:none, it throws an error. It's due to this long-standing bug in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=548397

The JS console says:

TypeError: window.getComputedStyle(...) is null selectize.min.js:2

The error is due to this line:
https://github.com/brianreavis/selectize.js/blob/6a071a2809802176ebc01703b98109784ec5b931/src/selectize.js#L7

In particular:

window.getComputedStyle(input, null).getPropertyValue('direction')

In the hidden iframe situation, window.getComputedStyle(input, null) returns null, but another function call is chained after it.

We've encountered this error on a different project, and our workaround is here:
rstudio/shiny#550

wch added a commit to wch/selectize.js that referenced this issue Jul 24, 2014
This is a workaround for a Firefox bug, where window.getComputedStyle()
returns null in an iframe with display:none.
https://bugzilla.mozilla.org/show_bug.cgi?id=548397
wch added a commit to wch/selectize.js that referenced this issue Jul 24, 2014
This is a workaround for a Firefox bug, where window.getComputedStyle()
returns null in an iframe with display:none.
https://bugzilla.mozilla.org/show_bug.cgi?id=548397
wch added a commit to wch/selectize.js that referenced this issue Sep 22, 2014
This is a workaround for a Firefox bug, where window.getComputedStyle()
returns null in an iframe with display:none.
https://bugzilla.mozilla.org/show_bug.cgi?id=548397
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

1 participant