Skip to main content

contain_sideways

Function contain_sideways 

Source
pub fn contain_sideways<E: InteractiveElement>(el: E) -> E
Expand description

Keep a sideways gesture inside the pane it started in.

The other half of pane, and the half Axes::Vertical does not want: a vertical pane at its end should hand the wheel to the page behind it (claim_wheel is that chaining), but a sideways gesture reaching a vertical ancestor is never right — unless that ancestor is restricted too, it will remap the delta and scroll down.

Applied by pane for the axes that need it. Public because a consumer wrapping bezel’s content in a scroller of its own has the same problem and the same fix.

Registered before the element’s own handler and so run after it — gpui bubbles the list backwards — which is why the pane has already moved by the time the event stops here.