title: React scroll event doesn't stop firing
body: <p>At work we're having some performance issues with rendering data tables so we've decided to try to virtualize a list &quot;window&quot;. Essentially following the same idea as <a href="https://github.com/bvaughn/react-window" rel="nofollow noreferrer">react-window</a>, whereby you only render the sublist - the one showing on your viewport - of your data list.</p>
  <p>For a myriad of reasons, we tried to implement the technique ourselves. In doing so, we learnt this is mostly done using <code>position: absolute</code> on each list item, which didn't really suitable for us. So we came up with the idea of just having two &quot;wrapper&quot; divs around the sublist we want to render.
  Essentially box1 would have the height equal to the combined height of all the list items before our window and box2 would have the height of all the items after our window. Every time the user scrolls, we figure out which indices to render and adjust the box heights.</p>
  <p>Unfortunately we ran into an issue where, when the user scrolls down, the scroll event keeps firing even after the user has stopped scrolling. This scrolls the list all the way to the end. It seems to work fine when scrolling up though, so we're really at a loss here. We couldn't figure out why it keeps firing.</p>
  <p><a href="https://codesandbox.io/s/react-hooks-playground-forked-lfz7i?file=/src/index.js" rel="nofollow noreferrer">Here's a link to an example</a>. I just replaced all the list item logic with a fixed box for simplicity. I've also added a timeout to the scroll handler so the scrolling up behaviour is more noticeable, otherwise it's too fast and the red upper box is not noticeable.</p>
  <p>Any help is much appreciated. Thanks in advance!</p>
  <p>EDIT: We're actually using this in a <code>&lt;table&gt;</code> element, which means solutions based on css <code>position</code> property will not work, given that that property has undefined behaviour for table elements, and it breaks the standard table layout.</p>