Skip to content

feat: add search to dropdown and multi-select fields#753

Open
gosiexon-zen wants to merge 1 commit intomasterfrom
mbien/add-search-to-dropdowns
Open

feat: add search to dropdown and multi-select fields#753
gosiexon-zen wants to merge 1 commit intomasterfrom
mbien/add-search-to-dropdowns

Conversation

@gosiexon-zen
Copy link
Contributor

@gosiexon-zen gosiexon-zen commented Feb 13, 2026

Description

Added possibility to search in drop-down fields: Tagger and MultiSelect component. DropDown component is used only for system fields.

PR with translations: #758

Jira: GG-3415 & GG-3416

Screenshots

Screen.Recording.2026-02-13.at.12.00.05.mov

Checklist

  • 📗 all commit messages follow the conventional commits standard
  • ⬅️ changes are compatible with RTL direction
  • ♿ Changes to the UI are tested for accessibility and compliant with WCAG 2.1.
  • 📝 changes are tested in Chrome, Firefox, Safari and Edge
  • 📱 changes are responsive and tested in mobile
  • 👍 PR is approved by @zendesk/vikings

@gosiexon-zen gosiexon-zen requested review from a team as code owners February 13, 2026 11:03
"@types/react": "^17.x",
"nwsapi": "^2.2.20"
"nwsapi": "^2.2.20",
"@zendeskgarden/container-utilities": "^1.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was to fix a Rollup build error. The @zendeskgarden/react-dropdowns.legacy package imports KEY_CODES from @zendeskgarden/container-utilities, but that export only exists in v1.x. Our package.json has @zendeskgarden/container-utilities at ^2.0.2 in dependencies, and v2.x removed the KEY_CODES export — so the legacy dropdowns package couldn't resolve it and the build failed.

SirishaNeduri
SirishaNeduri previously approved these changes Feb 13, 2026
@gosiexon-zen gosiexon-zen force-pushed the mbien/add-search-to-dropdowns branch 2 times, most recently from 9966bca to 475a925 Compare February 17, 2026 10:41
@gosiexon-zen gosiexon-zen force-pushed the mbien/add-search-to-dropdowns branch from 475a925 to 8b837ff Compare February 17, 2026 10:52
@melzreal
Copy link
Contributor

could you run yarn build and re-commit assets? currently shows a 91 thousand lines change

Copy link
Contributor

@Fredx87 Fredx87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some general comments:

Difference with Support

I noticed a couple of differences between this component and the one in support. It doesn't need to be exactly the same, but it would be nice to have some consistency.

In our case, the search results are presented "flat" (both for tagger and multiselect):

Image

while in Support they are presented with the full path:

Image

I think it is nicer to see the full path, since we also show it when an item is selected. It also nice that it highlights the search string

Second difference, when an item is selected from search in the Tagger component, we don't show it as selected when the user opens the combobox, in some cases we show a completely different set of options where the selected one is not visible (in this case "precision" is selected):

Image

While support always show the right option as selected:

Image

I think this is a big problem for a11y. for a screen reader user there is no way to know which option is currently selected.

There are also some differences in how we present things (search placeholder, no results, ...). This may be ok since are coherent with the lookup fields

Duplicated logic

There is a lot of duplicated logic in the two components around the search logic, like search state, filtered options, .... It would be better to consolidate it in a single hook, maybe even reusing the useNestedOptions hooks

No tests

There are no tests for the search logic and the components. It is true that we don't have tests for these two components right now, but we can take the opportunity to add them

Translation strings

Probably it is better to create a separate PR with the translations string only, so we avoid releasing this with untranslated strings

@Fredx87
Copy link
Contributor

Fredx87 commented Feb 23, 2026

could you run yarn build and re-commit assets? currently shows a 91 thousand lines change

I said it countless time, but there is no need to commit the assets, they just create noise and also conflicts to resolve, without any benefit. The only helpful thing is the ability for others to test the branch without previewing locally, but I if I need to I just checkout the branch and run the preview

@gosiexon-zen gosiexon-zen force-pushed the mbien/add-search-to-dropdowns branch from 8b837ff to 68535fb Compare February 24, 2026 15:58
- Add search functionality to Tagger and MultiSelect fields
- Create useFieldSearch hook to consolidate duplicated search logic
- Add HighlightMatch component for search result highlighting
- Add comprehensive tests for hook and components
- Show full path for nested options in search results
- Navigate to parent group after selecting nested option in Tagger
- Reset to root group when focusing MultiSelect after search

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@gosiexon-zen gosiexon-zen force-pushed the mbien/add-search-to-dropdowns branch from 68535fb to 52702e5 Compare February 25, 2026 13:39
@gosiexon-zen gosiexon-zen requested a review from Fredx87 February 25, 2026 13:52
@pfemo
Copy link

pfemo commented Mar 2, 2026

I'm not exactly a typescript expert but how is the useFieldSearch being used?
I don't see it referenced anywhere?

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.

5 participants