Fix highlight clamping and add VirtualList to CommandPalette#6
Merged
Conversation
…andPalette Avoid state updates during render in Select, MultiSelect, and Autocomplete by moving highlightIndex clamping into useEffect. Memoize Autocomplete's filtered list. Retrofit CommandPalette with VirtualList and expose maxVisible/paginatorStyle props.
zion-off
added a commit
that referenced
this pull request
Feb 23, 2026
FocusStore gains store.dispatch(input, key) — the full dispatch algorithm: passive-scope skipping (the key new capability), capture mode, trap boundary, and mounted-binding fallback. normalizeKey is called inside the store. FocusContext is updated to dual-register every node in the store and to call store.focusNode whenever it moves focus. This keeps the store's active branch path and focusedId in sync with FocusContext's tree so that store.dispatch walks the correct nodes while old UI components still register through FocusContext. The bridge is removed in chunk #6. InputRouter is reduced to a single line: useInput((input, key) => store.dispatch(input, key)) The inline dispatch loop and its useFocusContext/useStore calls are gone.
zion-off
added a commit
that referenced
this pull request
Feb 24, 2026
FocusStore gains store.dispatch(input, key) — the full dispatch algorithm: passive-scope skipping (the key new capability), capture mode, trap boundary, and mounted-binding fallback. normalizeKey is called inside the store. FocusContext is updated to dual-register every node in the store and to call store.focusNode whenever it moves focus. This keeps the store's active branch path and focusedId in sync with FocusContext's tree so that store.dispatch walks the correct nodes while old UI components still register through FocusContext. The bridge is removed in chunk #6. InputRouter is reduced to a single line: useInput((input, key) => store.dispatch(input, key)) The inline dispatch loop and its useFocusContext/useStore calls are gone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The Select, MultiSelect, Autocomplete, and CommandPalette components were calling
setHighlightIndexduring render to clamp the highlight when the options list shrank. This violates React's rules and can cause render loops or warnings.Changes
useEffectin Select, MultiSelect, and AutocompleteuseMemoto avoid recalculating on every render.map()list in CommandPalette withVirtualList, addingmaxVisibleandpaginatorStyleprops for scrollable command lists