Skip to content

Stop events for a brief moment #67

@saurabhnemade

Description

@saurabhnemade

This could be a new feature altogether.

What I am looking for: I want to stop the intersection observer/callback from my component. I want to have programmatic start and stop with context/custom hook.
What currently happens: Currently on every scroll event intersection observer is triggered and is calling the callback function.

Here is one case:
Let's say we have layout of tabs and we are treating tab selection as a pointer to specific div element on page where we scroll to on click of tab.
On scroll of the page I can set tab's state but if I try to do programmatic scroll on page (i.e. on click of tab) it will trigger the intersection observer and in turn the callback.

To handle such situations we can introduce another local state and expose method that can update it (either true/false). Based on this new state we can decide whether to invoke the callback on intersection observer.

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