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

How to check if element is only Partially Visible? #164

Open
uijaswanthi opened this issue Aug 13, 2019 · 0 comments
Open

How to check if element is only Partially Visible? #164

uijaswanthi opened this issue Aug 13, 2019 · 0 comments

Comments

@uijaswanthi
Copy link

From the below example i understood that isVisible will return true even if div element visible partially because I added partialVisibility prop. But is there any way i can say if div element is partially visible or fully visible?

<VisibilitySensor key={list} partialVisibility containment={containmentDOMRect}>
  {({ isVisible }) => {
    return (
      <div
        style={{
          height: 100,
          lineHeight: "100px",
          color: "white",
          backgroundColor: isVisible ? "green" : "red",
          margin: 5
        }}
      >
      I am #{list}
      </div>);
    }}
</VisibilitySensor>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant