nhn / tui.grid

🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
http://ui.toast.com/tui-grid/
MIT License
2.42k stars 394 forks source link

Fix: Limit when to prevent the default wheel event (fix #1848) #1851

Open gpetrioli opened 1 year ago

gpetrioli commented 1 year ago

Please check if the PR fulfills these requirements

Description

The code prevents the default wheel event only if there is available scroll inside the grid that will happen.

This means that when we have reached the end of the scroll in all directions, it will allow the wheel event to bubble higher and be caught by the browser so that the page will continue scrolling.

Fixes #1848

gpetrioli commented 1 year ago

Just a heads up,

it looks like PR #1816 introduced a very greedy event handler, that completely consumes all wheel events that happen while the mouse is over a grid.

This fix introduces some checks that will allow an event to bubble to the top (not get consumed by the handler) if the grid does not need to consume it (if there is no scroll to happen in the direction the wheel events is occurring).

stale[bot] commented 1 year ago

This issue has been automatically marked as inactive because there hasn’t been much going on it lately. It is going to be closed after 7 days. Thanks!