Skip to main content

Module cmdk_selection

Module cmdk_selection 

Source
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 amount steps, skipping disabled items.
clamp_active_index
Clamps an active index to a valid, enabled index.
first_enabled
Returns the first enabled index, or None if all items are disabled.
last_enabled
Returns the last enabled index, or None if all items are disabled.
next_active_index
Returns the next active index given the current active index, disabled flags, and direction.