bvaughn / react-window

React components for efficiently rendering large lists and tabular data
https://react-window.now.sh/
MIT License
15.48k stars 778 forks source link

Allow canceling scroll #763

Open viveleroi opened 2 months ago

viveleroi commented 2 months ago

I would like a way to disallow a user to scroll the content.

We have a tree component (using react-vtree) that allows editing tree nodes. We plan to prompt a user to save or reject their changes when they start scrolling the tree (because there are too many UX gotchas otherwise). However I see no way to do this and I can't use the native onScroll props on the react-window elements.

For now I'm using the outerRef and cancelling the mouse wheel events, but it would be ideal if there was a way to preventDefault on the custom onScroll