gpui: Add `restrict_scroll_to_axis` to match web scrolling behavior (#25963)
This PR adds a new `restrict_scroll_to_axis` style to allow consumers to opt-in to the scrolling behavior found on the web. When this is enabled the behavior will be such that: - Scrolling using the mouse wheel will only scroll the Y axis - Scrolling using the mouse wheel with <kbd>Shift</kbd> held will only scroll the X axis This behavior is useful in scenarios where you have some vertically-scrollable content that is interspersed with horizontally-scrollable elements, as otherwise the scroll will be constantly hijacked by the horizontally-scrollable elements while trying to scroll up and down in the vertically-scrollable container. I think that this behavior should be the default, but it's a bit of a sweeping change to make all at once, so for now it remains opt-in. Release Notes: - N/A
M
Marshall Bowers committed
7321c814ced25ad70eceb1f345575ea71f9b487b
Parent: ac3cb3d
Committed by GitHub <noreply@github.com>
on 3/3/2025, 10:32:08 PM