Skip to content

Conversation

ace-of-aces
Copy link

Hey there!

I've found a small issue that occurs when having a searching for something on the docs' cmd+k command menu and then clearing it.

The issue

What currently happens is that the CommandMenuItem component isn't re-rendered and made aware of changes in the search after clearing a given search input, and the mutation observer won't trigger any events. This leads to the bottom section of the CommandMenu (the shortcut hints) being out of sync with the highlighted command menu item.

It's best visible in a screen recording (watch how the bottom shortcut hints don't match the highlighted item after clearing the input):

Screen.Recording.2025-10-11.at.22.54.03.mov

My fix

I just added a call to useCommandState inside CommandMenuItem which makes it properly reactive. I hope this is the best solution for this.

After:

Screen.Recording.2025-10-11.at.22.55.52.mov

Copy link

vercel bot commented Oct 11, 2025

@ace-of-aces is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant