-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combobox/add custom element when suggestions not found #66142
base: trunk
Are you sure you want to change the base?
Combobox/add custom element when suggestions not found #66142
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Thank you for opening this PR! @WordPress/gutenberg-components , what do we think about adding a similar feature directly to the component (no props) and displaying a more generic message? Something like "No items found". |
Yeah, I think it might be a better experience than what we're doing now (showing nothing): @WordPress/gutenberg-design any thoughts or preferences? |
Sounds good to me. Any downsides? |
Can't think of any. Even that string exists already and will inherit existing translations immediately: gutenberg/packages/edit-site/src/components/sidebar-navigation-screen-patterns/index.js Line 139 in 6831711
|
@vykes-mac could you change this PR so that the message is always shown (no extra props needed) and the text reads "No items found" ? Thank you 🙏 |
Thanks for implementing this @vykes-mac. 🙌 |
@ciampo What if we want to customise the copy that's displayed there? Eg. the list is showing |
Would "No matches found" be a more generic wording in this case? To be honest I prefer not adding a prop right now to customize this, as it will naturally be customizable in the planned version 2 of this component, which will be based on Ariakit and more modular. |
@mirka I'll proceed with the |
What?
The PR adds a prop to the
ComboxControl
component so that an element can be passed to be rendered when there are no suggestions found based on the search query entered.Why?
This PR is more of an enhancement and provides a better user experience when searching the the
ComboboxControl
How?
Accepts
__experimentalRenderNoSuggestionsFound
component and displays it when no suggestion is found in theSuggestionsList
component.Testing Instructions
Open Storybook and pick the Components > ComboboxControl component. Search for an item that doesn't exist
and you should see
No items found
state.Screenshots or screencast