mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Don't handle scroll if no axes are accepted
In some cases, we might be hovering directly on an element scrollable e.g. horizontally, but we are scrolling vertically. In these cases, we need to delegate the scroll to the parent instead of stalling the user's scroll.
This commit is contained in:
parent
010463c424
commit
c5d0af54d0
Notes:
github-actions[bot]
2025-03-01 22:55:47 +00:00
Author: https://github.com/vaxerski 🔰
Commit: c5d0af54d0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3753
Reviewed-by: https://github.com/kalenikaliaksandr ✅
1 changed files with 2 additions and 1 deletions
|
@ -954,7 +954,8 @@ Paintable::DispatchEventOfSameName PaintableBox::handle_mousemove(Badge<EventHan
|
|||
|
||||
bool PaintableBox::handle_mousewheel(Badge<EventHandler>, CSSPixelPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
{
|
||||
if (!could_be_scrolled_by_wheel_event()) {
|
||||
// if none of the axes we scrolled with can be accepted by this element, don't handle scroll.
|
||||
if ((!wheel_delta_x || !could_be_scrolled_by_wheel_event(ScrollDirection::Horizontal)) && (!wheel_delta_y || !could_be_scrolled_by_wheel_event(ScrollDirection::Vertical))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue