Skip to main content

selection_host

Function selection_host 

Source
pub fn selection_host<State: 'static, F, M>(
    items: impl ViewSeq<State, M>,
    selected: &BTreeSet<usize>,
    on_toggle: F,
) -> SelectionHostView<State>
where F: Fn(&mut State, usize) + 'static,
Expand description

Wrap items in the selection gesture router: tap toggles membership while selected is non-empty, otherwise fires on_activate (SelectionHostView::on_activate); a long-press selects an unselected row (see the module docs’ Wrapper section). on_toggle reports the row index whose membership should flip.