joshwnj / joshwnj/react-visibility-sensor

partialVisibility bottom remains visible when the viewport is below the component

Open
#158 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.3k
Forks
192
PR merge metrics
No merged PRs in 30d

Description

Hello!

This library has been very useful but there's a small functionality issue with partialVisibility that I'm not sure works as intended.

When partialVisibility is set to 'bottom', the sensor triggers when the bottom of the element is visible (as desired). But then, when the user scrolls away from the element, to the point that the card is out of the viewport, the sensor still claims the element is visible.

In the below demo, try changing partialVisibility to 'bottom' then scroll below the red bar. You'll observe that the output claims "Contained Element is now visible"

https://codepen.io/joshwnj/pen/PjwVym

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.