Feat/search dropdown#114
Open
giuliana-gladeye wants to merge 3 commits into
Open
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.
Added search to DropdownMenu
Adds an optional search box to our existing
DropdownMenuso you can filter items in place. It's opt-in per menu — if a menu doesn't have a<DropdownMenuSearch />in it, nothing changes and Radix's normal typeahead still works. Everything is wired through a small internal context, so the usage stays the same, you just drop new parts intoDropdownMenuContent.What's new
<DropdownMenuSearch />— a search input you put insideDropdownMenuContent. Hidden by default and reveals when you start typing. PassalwaysVisibleif you want it showing straight away.<DropdownMenuEmpty />— a "no results" row that only shows when the query doesn't match any items.DropdownMenuItem/CheckboxItem/RadioItemhide themselves when they don't match. Matches ontextValue, falling back to the item's text.Usage
If an item has an icon/avatar instead of plain text, give it a
textValueso it filters properly.Heads up
Most of this is working around how Radix handles focus and keyboard:
Contentand callingpreventDefault()— Radix bails when the event's already defaultPrevented.SubContent's children inline while searching — Radix keeps sub items in a separate popover that isn't mounted during a top-level search, so there's no other way to filter them.Known gaps
DropdownMenuSubContent— wrapping it breaks it.Extras
DropdownMenuLabelstyling, since it looked the same as a clickable item making it confusing.<DropdownMenuSearch />to bothRadioDropdownandFilterDropdowncomponents. We need to update the docs for them afterfeat/docsget's merged.SortSelectorcomponent too @Shrinks99 ??Screen.Recording.2026-07-14.at.5.33.05.PM.mov
Linear ticket