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

Added a withFocus prop and EventListener which detects if the document has focus. #54

Open cilliand opened 5 years ago

cilliand commented 5 years ago

Added a withFocus prop and EventListener which detects if the document has focus. This can then be used to ensure isVisible tracking only happens when the user is looking at their screen good for checking if a user has "read" a message for example.

This includes body prop from #52

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-5.5%) to 91.453% when pulling 7918ef6920c2c6b267a4a13f6a4c83c2964fa8d0 on cilliand:master into f4724fb63263b3e026675ff5f5b69b8c57d13036 on fkhadra:master.