DioxusLabs / blitz

High performance HTML and CSS renderer powered by WGPU
Apache License 2.0
2.12k stars 42 forks source link

Non-root scrolling #121

Closed cfraz89 closed 2 months ago

cfraz89 commented 3 months 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 3 months 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 3 months ago

No problems

cfraz89 commented 2 months ago

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