0

Using react-virtualised table with infinite scroll within a large page of content, if the user scrolls to the bottom of the table and the next set of data has not finished loading, the mouse wheel event bubbles up to the window, and the window continues to scroll past the table.

Is there a way to intercept the mouse wheel event to call preventDefault? This could check if the user is at the bottom of the table or not and whether to prevent bubbling.

The onScroll prop provides some information but not the event and there doesn't seem to be a way to access the onWheel event on the grid element that handles the scrolling through props.

J-R
  • 117
  • 2
  • 9

1 Answers1

0

You can intercept and prevent the event bubbling in the usual way, with a wrapper HTMLElement around Table.

<div onClick={yourHandlerThatPreventsDefault}>
  <Table {...props} />
</div>
<!-- Other Tables here ... -->
bvaughn
  • 13,300
  • 45
  • 46