Skip to content

Checking if the element is already in view? #6

@zaynv

Description

@zaynv

Use case:

There is a fixed button on bototm of the screen that scrolls into a View when pressed on. However, I want to hide that button if the element has already been scrolled to manually. Is there a way to see if my element is already at the current scroll position?

My code:

<CustomScrollView>
  <ScrollIntoView>
    <View> {/* MyElement */}
      ...
    </View>
  </ScrollIntoView>
</CustomScrollView>
<FloatingButton hidden={/* I want to check here if MyElement is already scrolled to}>Scroll to View</FloatingButton>

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions