Expand description
Headless cmdk-style “active option” selection helpers.
This is intentionally small and deterministic: it only provides index math for keeping focus in the input field while moving a highlighted row in a results list.
Functions§
- advance_
active_ index - Moves the active index by
amountsteps, skipping disabled items. - clamp_
active_ index - Clamps an active index to a valid, enabled index.
- first_
enabled - Returns the first enabled index, or
Noneif all items are disabled. - last_
enabled - Returns the last enabled index, or
Noneif all items are disabled. - next_
active_ index - Returns the next active index given the current active index, disabled flags, and direction.