You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Space toggles the highlighted item; Enter confirms the full selection via
onConfirm. defaultSelectedKeys pre-populates checked state. onToggle fires
on each individual toggle. Hotkeys are disabled in multi-select mode to
avoid Space ambiguity. DefaultIndicatorComponent renders [x]/[ ] checkboxes
when isChecked is provided. isChecked is threaded through to both custom
indicatorComponent and itemComponent. 13 new tests cover all paths.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@@ -144,23 +180,27 @@ function MyCustomSelect({ items, onSelect }) {
144
180
}
145
181
```
146
182
147
-
The hook accepts all the same props as `EnhancedSelectInput` except `indicatorComponent`, `itemComponent`, and `showScrollIndicators`. It returns `{ selectedIndex, rotateIndex, visibleItems, hasItems, itemsAbove, itemsBelow }`.
183
+
The hook accepts all the same props as `EnhancedSelectInput` except `indicatorComponent`, `itemComponent`, and `showScrollIndicators`. It returns `{ selectedIndex, rotateIndex, visibleItems, hasItems, itemsAbove, itemsBelow, checkedKeys }`. `checkedKeys` is a `Set<string>` of checked item keys — only populated when `multiple` is `true`.
In **single-select** mode, `Enter` calls `onSelect` and hotkeys select immediately. In **multi-select** mode (`multiple={true}`), `Space` toggles the highlighted item and `Enter` calls `onConfirm` with all checked items. Hotkeys are disabled in multi-select mode to avoid ambiguity with `Space`.
190
232
191
-
Hotkeys (when assigned) select the item immediately. Disabled items are automatically skipped during navigation, including by `Home` and `End`.
233
+
Disabled items are automatically skipped during navigation, including by `Home` and `End`.
192
234
193
235
`Escape` calls the `onCancel` prop when provided — useful for multi-step CLI flows that need a "go back" action.
0 commit comments