You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some periods where more than one element is visible at the same time as you can partially see the first element whilst scrolling to the following element. When scrolling back up, the second element will not be visible any more as it scrolls away from the viewport, yet the first element will still be visible and the state is still true without calling the onChange function again.
I need to be able to call the onChange function again when this happens, so that when the second element goes out of view, I can update the state to then set the index of the first element into the component state again - the visible element index state will still be set to 1 here rather than 0 as the isVisible boolean of the first element hasn't changed.
Any idea on how to achieve this?
The text was updated successfully, but these errors were encountered:
joanacdias
changed the title
Having only one element visible at a time
Calling onChange in one element when another element goes out of view
May 14, 2021
There are some periods where more than one element is visible at the same time as you can partially see the first element whilst scrolling to the following element. When scrolling back up, the second element will not be visible any more as it scrolls away from the viewport, yet the first element will still be visible and the state is still true without calling the onChange function again.
I need to be able to call the onChange function again when this happens, so that when the second element goes out of view, I can update the state to then set the index of the first element into the component state again - the visible element index state will still be set to 1 here rather than 0 as the isVisible boolean of the first element hasn't changed.
Any idea on how to achieve this?
The text was updated successfully, but these errors were encountered: