Skip to content

Conversation

charliepark
Copy link
Contributor

@charliepark charliepark commented Jun 3, 2024

This uses the Headless combobox component (here), making a few tweaks to align with our current dropdowns.

Fixes #1942

Screenshot 2024-06-03 at 3 23 50 PM

Also added a few tests to check for combobox interactivity.

Copy link

vercel bot commented Jun 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Jun 21, 2024 8:51pm

@charliepark
Copy link
Contributor Author

In migrating a few more Listboxes over to Comboboxes, I discovered a few props that were missing that I've added, like for a disabled state.

It also appears that the ComboboxOption, which currently has a value: string and a label: string, isn't as flexible as the existing ListboxOption, on two accounts. First, Listboxes allow for rendered HTML elements, meaning we can use richer designs for the dropdowns. Second, all of our existing implementations have an item where the label and the value are identical. We'll have occasions — especially with those rendered HTML elements — where the selected value (a string) will be different from the label (a string, or a ReactNode).

This PR has been going long enough that I want to treat those other situations separately.

Copy link
Collaborator

@david-crespo david-crespo left a comment

Choose a reason for hiding this comment

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

Very nice. Let's do the followup work in followups and get this on dogfood ASAP so people can try it.

  • More tests
  • virtual
  • Enable fancier option rendering
  • Think about when to use listbox vs. combobox — I figure listbox is simpler for things where we expect there to be a small number of times, but we need a clearer standard

@david-crespo david-crespo merged commit f1fce1b into main Jun 24, 2024
@david-crespo david-crespo deleted the stub_of_new_combobox branch June 24, 2024 20:51
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.

Need combobox component + field
2 participants