4

Is it possible (if yes - how) to detect end of scrolling event in react-virtualized if Grid.state.scrollPositionChangeReason = 'requested' ?

It is easy to detect end of scrolling event if Grid.state.scrollPositionChangeReason = 'observed', because we can just check Grid.state.isScrolling.

Source code of Grid.state.scrollPositionChangeReason

I know, it is a mortal sin here, but I can't share a full example of my code

I will appreciate any help.

Believe me, I have tried a lot of approaches and spent a lot of hours trying to detect end of scrolling. So please, don't think I did not tried anything

This is the super minimal example of my code:

class Foo extends React.Component {
  onScroll = ({ scrollTop }) => setState = ({ scrollTop })
  
  isEndOfScrolling = () => this.state.scrollTop === this.listRef.Grid.state.scrollTop

  render() {
    return <List
      onScroll={this.onScroll}
      ref={(node) => this.listRef = node}
    />
  }
}

So, my solution works in my particular case, but I believe it is not perfect

0 Answers0