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

Add option to detect elements that have no size #155

Open
Gyanreyer opened this issue Feb 19, 2019 · 4 comments
Open

Add option to detect elements that have no size #155

Gyanreyer opened this issue Feb 19, 2019 · 4 comments

Comments

@Gyanreyer
Copy link

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.

@jetpack3331
Copy link

Any progress here?

@Gyanreyer
Copy link
Author

Thanks for reminding me about this! I just went ahead and threw together a PR for it: #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.

@kula124p
Copy link

I "hacked" this by setting min hight of an "invisible" element to 1px in css
Works fine in my case :)

@arkadash
Copy link

arkadash commented Mar 4, 2020

Any news about this one? I can see it's still in PR...
Can you please update the state?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants