DioxusLabs / blitz

High performance HTML and CSS renderer powered by WGPU
MIT License
1.98k stars 38 forks source link

Non-root scrolling #121

Closed cfraz89 closed 4 weeks ago

cfraz89 commented 1 month ago

Implements scrolling on mouse-wheel events, of any node which is hovered. When a node has hit its scroll boundary, scrolling bubbles up to the node's parent, all the way up to the root element. The root (html) element is sized to the viewport (is this technically the right thing to do?) and therefore will automatically handle root-level scrolling.

Adds an example scrolling which demos scrolling in the middle element. Scrolling the root element can be tested by resizing the window smaller than the content and scrolling, otherwise the tailwind example has a large content area and should be scrollable too.

Todo: Touch scrolling, flinging with momentum (even with mouse wheel? chromium does this).

jkelleyrtp commented 1 month ago

Thanks for the PR! Nico's currently on break so I'll take a look at it, but it'll take a moment :)

cfraz89 commented 1 month ago

No problems

cfraz89 commented 1 month ago

Thanks for the feedback, all makes sense. I revamped the PR: