wnr / element-resize-detector

Optimized cross-browser resize listener for elements.
MIT License
1.32k stars 118 forks source link

getComputedStyle firefox, question #68

Closed SeeThruHead closed 7 years ago

SeeThruHead commented 7 years ago

I'm having an issue using your library in firefox. Seem to be that in my application getComputedStyle(element) inside scroll.js returns null in firefox. I assume this is my fault somehow but am unable to pinpoint how. Was hoping you might have some insight.

SeeThruHead commented 7 years ago

i think it is related to this https://bugzilla.mozilla.org/show_bug.cgi?id=795520 i am rendering inside an iframe.

wnr commented 7 years ago

Hmm that is really interesting! I haven't noticed any similar issues, so I guess you are on the right track regarding rendering inside an iframe. Would it be possible for you to share a minimal jsfiddle displaying the problem?

wnr commented 7 years ago

I'm going to close this. Please reopen if you have a minimal example that displays the problem.

xaviervia commented 7 years ago

Please let's reopen this. Here is the example:

https://example-get-computed-style-failing-rybndfgpil.now.sh/ <- failing https://example-get-computed-style-failing-rybndfgpil.now.sh/iframe.html <- what it should be

The content of the iframe As you can see in the console, it logs the contents:

screen shot 2017-03-30 at 14 13 28

On a hidden iframe If logs null in the console.

screen shot 2017-03-30 at 14 13 38
wnr commented 7 years ago

Thank you for the information, I'll analyze this asap.

xaviervia commented 7 years ago

No worries. Let me know if I can be of any help.

wnr commented 7 years ago

I have now pushed a fix in the develop branch. Could you try it out?

wnr commented 7 years ago

Did you get any chance to try this out? It seems to work fine for me with the fix in the develop branch.

wnr commented 7 years ago

Fix released in 1.1.12.

xaviervia commented 7 years ago

Hi! I'm sorry I was out on vacations when this happened. Thanks a lot for fixing it! I will make sure to update soon :)