Skip to main content

next_selectable

Function next_selectable 

Source
pub fn next_selectable(
    items: &[Item],
    from: Option<usize>,
    delta: isize,
) -> Option<usize>
Expand description

The next row the keyboard can land on, delta deciding the direction: separators and disabled rows are stepped straight over, and both ends wrap. from of None enters the menu at the edge the direction comes from.

popover::menu_step cannot do this — it counts rows and knows nothing about which of them can be landed on. None back means nothing in the menu is selectable, which is the one shape that would otherwise spin forever.