Skip to main content

apply_a11y_expand_to_dropdown

Function apply_a11y_expand_to_dropdown 

Source
pub fn apply_a11y_expand_to_dropdown(
    headers: Query<'_, '_, (&DropdownButton, &A11yState), Changed<A11yState>>,
    store: ResMut<'_, PropertyStore>,
)
Expand description

Mirrors A11yState::EXPANDED onto the dropdown’s open-state signal whenever the bit changes.

window-winit’s accesskit action handler responds to assistive-tech Action::Expand / Action::Collapse by flipping A11yState::EXPANDED on the receiving entity (today the dropdown header). Without a downstream consumer that bit flip was inert - the open signal that gates the panel body’s <if eq="true"> never moved. This system closes that loop: a Changed<A11yState> filter picks the entity up on the next tick and PropertyStore::set_global_bool writes "true" / "false" to the header’s open_signal. set_global_bool no-ops when the value is unchanged, so click-driven updates that already wrote the signal don’t bounce back through the AT path.