Repository navigation
palette-react: publish aria-activedescendant for the initial highlight (#68) - #72
Merged
Merged
Conversation
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.
Closes #68.
cmdk 1.1.1 sets
aria-selectedon the first option at mount but only publishes its id on the input when the highlight moves (selectedItemIdis written only fromsetState('value')). It also overrides anyaria-activedescendantprop, and a controlledvalueis applied without publishing, so neither of the issue's options works as written.use-active-descendant.tsmirrors the selected option's id onto the input (callback ref on the cmdk root + MutationObserver onaria-selected), following the root through list/picker/list remounts and clearing it when nothing matches.Tests: the loose assertion is tightened; new ones for filtering (incl. no match) and returning from the picker chain. Mutation-checked (without the ref, 3 tests fail). Package suite 40/40, tsc clean. Skill note and changeset updated.
Adversarial review (fresh Opus): fix-then-merge. Confirmed: the enum picker step (its own cmdk root) still had the bug — fixed with the same hook and a test (mutation-checked). Verified holding: no observer loop, no stale ids across mount/arrows/filter/no-match/hover/unregister/list-picker round trip, StrictMode, SSR; the claim that cmdk cannot publish it via controlled value is true. Suspicion not run: React 18 (only 19 installed). Cosmetic: cmdk leaves aria-activedescendant unset on the listbox element.
🤖 Generated with Claude Code