wnr / element-resize-detector

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

Doesn't work in jsfiddle #31

Closed facboy closed 8 years ago

facboy commented 8 years ago

I might be doing something really stupid here, but I cannot get this to work at all in JSFiddle. I'm actually trying to reproduce another problem I'm having with our prod site so I can submit an issue for that, but I can't get this library to work at all on JSFiddle.

facboy commented 8 years ago

I managed to get a demo working on plunkr: http://plnkr.co/edit/bFEUseCv5G1SefhCrbL9

When it is set to use strategy: "scroll" it constantly logs "Scroll: " "Poll. Style not resolved." in the console. It works when using object.

wnr commented 8 years ago

Hmm interesting. It seems to work if you change the #resize to display: block. I'll investigate why this is later today.

facboy commented 8 years ago

The problem I was actually trying to debug is to do with the listener never being fired when using scroll strategy, I'm not sure whether it's something to do with me having the element itself be inside a scroll container. While trying to debug this on Plunker I did find that the hidden sensor div is interfering with the page layout:

http://plnkr.co/oRPXltoG5kP7iBTgWSov

Notice how a scrollbar appears even though there is no content.

Compare this with marcj's ResizeSensor:

http://plnkr.co/4Pm8OTXKAfZyvonOoVTd

No scrollbar is present.

wnr commented 8 years ago

Interesting. Your linked example seems to work fine on my computer. Which OS and browser are you using? Could you upload an image or a video that shows the leaked scrollbars?

wnr commented 8 years ago

This is how it looks for me. https://v.usetapes.com/SmanSPDMtY

facboy commented 8 years ago

Ubuntu 14.04.3, Chrome 47.0.2526.73.

screenshot

wnr commented 8 years ago

Okay thanks. I've created a separate issue to handle the scroll polling issue with inline elements (such as span). I'll investigate the visible scrollbars as soon as my virtual installation of Ubuntu is finished.

wnr commented 8 years ago

This should now have been fixed in the 1.1.0 release