pub fn apply_a11y_scroll_into_view(
requests: ResMut<'_, A11yScrollIntoViewRequests>,
parents: Query<'_, '_, &ChildOf>,
transforms: Query<'_, '_, &Transform>,
scrolls: Query<'_, '_, (&Transform, &mut Scroll, &mut ScrollOffset)>,
)Expand description
W5.3 consumer for inbound Action::ScrollIntoView AccessKit actions.
- Drains
lumen_core::components::A11yScrollIntoViewRequestseach tick. For every requested entity, walks the [ChildOf] chain up to the nearest ancestor that carriesScroll+ScrollOffsetand updates the offset so the target’s bounding box sits inside the container’s viewport rect. - Vertical-axis containers move the offset along Y, horizontal along
X,
Bothalong both axes simultaneously. - When the target is already fully visible, the offset is left untouched (idempotent - repeated requests don’t drift).
- Velocity on the target axis is zeroed so a previously-fired inertial fling does not immediately scroll back away from the focused element.
- The actual clamp to
[0, content - viewport]is left toclamp_scroll_offsetswhich runs inTickStage::A11ySyncafter this system.