ref(cmdk): Update new cmd+k's focus to be clearer#111381
Merged
Conversation
Comment on lines
+202
to
+204
| li[data-focused] > ${InnerWrap} { | ||
| outline: 2px solid ${p => p.theme.tokens.focus.default}; | ||
| } |
Contributor
There was a problem hiding this comment.
Bug: The new CSS rule targets li[data-focused], but this attribute is never set on the list items, so the focus outline will not appear.
Severity: MEDIUM
Suggested Fix
Modify the component that renders the <li> items to add the data-focused attribute when the isFocused state is true. For example: <li data-focused={isFocused} {...props}>. Alternatively, change the CSS selector to use a class or style that is already being applied based on the isFocused state.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: static/app/components/commandPalette/ui/list.tsx#L202-L204
Potential issue: A new CSS rule was added to display a focus outline on command palette
list items using the `li[data-focused]` selector. However, the `data-focused` attribute
is never actually set on the `<li>` DOM elements. The `useOption` hook from React Aria
provides an `isFocused` state, but this is not being used to apply the `data-focused`
attribute to the element. As a result, the CSS selector will never match, and the
intended focus outline will not be visible, negatively impacting keyboard navigation and
accessibility.
Did we get this right? 👍 / 👎 to inform future reviews.
jshchnz
approved these changes
Mar 24, 2026
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.

Before (note the tiny weird focus state):

After
