Open Gyanreyer opened 5 years ago
Any progress here?
Thanks for reminding me about this! I just went ahead and threw together a PR for it: https://github.com/joshwnj/react-visibility-sensor/pull/167
For now if you just need something to work, the best (but kinda gross) solution is just going to be setting a min-height: 1px
and min-width: 1px
style on the placeholder element to make sure it will have some size that can be detected.
I "hacked" this by setting min hight of an "invisible" element to 1px in css Works fine in my case :)
Any news about this one? I can see it's still in PR... Can you please update the state?
I have a scenario where I am implementing a basic form of lazy loading where I'm waiting for an empty element to become visible before loading an element inside of it - this worked fine until I recently upgraded to a more recent version of react-visibility-sensor and discovered that the ability to detect the visibility of elements with 0 width/height has been disabled.
I understand why this was done, but I would love some sort of option that would allow you to still detect the visibility of elements with no width/height.