fkhadra / react-on-screen

Check if a react component in the viewport
https://fkhadra.github.io/react-on-screen/
MIT License
405 stars 50 forks source link

Detect if component is not display: none #16

Closed tapayne88 closed 6 years ago

tapayne88 commented 6 years ago

Hi again, I've found that if my react app is on the page but display: none the visibility check thinks everything is visible. This seems to be because top, right, bottom, left all report as 0. A quick check in isComponentVisible should remove this false positives.

Happy to submit a PR.

Thanks, Tom

fkhadra commented 6 years ago

PR are welcome 😁