Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

How to get the element that was clicked on #118

Open
watch2raff opened this issue Sep 27, 2019 · 1 comment
Open

How to get the element that was clicked on #118

watch2raff opened this issue Sep 27, 2019 · 1 comment

Comments

@watch2raff
Copy link

Function onUpdate() return element which was scrolled.
Is there a possibility get element that was clicked ?

After all, currentСlass is-current is added to element.
Please help.

@andrewywoo
Copy link

The callback function passed into onUpdate seems to be passing back the DOM element.

You can pass an anonymous function to pass element into your handle function.
onUpdate={element => handleOnUpdate(element)}

And then your handle function can be declared with a parameter which knows which DOM element was scrolled to.

function handleOnUpdate(element){
    //code here
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants