-
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, FormTokenField: show message when no matches found #66142
Changes from 8 commits
bfb3f06
7037c79
e945b6e
c824183
e12aec4
0bc3703
16ca239
edb25fd
c017455
f47c999
16de046
604bce9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import type { MouseEventHandler, ReactNode } from 'react'; | |
* WordPress dependencies | ||
*/ | ||
import { useRefEffect } from '@wordpress/compose'; | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
/** | ||
* Internal dependencies | ||
|
@@ -156,6 +157,11 @@ export function SuggestionsList< | |
); | ||
/* eslint-enable jsx-a11y/click-events-have-key-events */ | ||
} ) } | ||
{ suggestions.length === 0 && ( | ||
<li className="components-form-token-field__suggestion is-empty"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Were you planning on styling the &:not(.is-empty) {
cursor: pointer;
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the class is more of placeholder so that where the component is used the user can easily overide the styling with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That is something that we actively discourage — internal classnames are not public APIs and should not be considered as such. Please do not use the |
||
{ __( 'No items found' ) } | ||
</li> | ||
) } | ||
</ul> | ||
); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this also affects the
FormTokenField
component when the__experimentalExpandOnFocus
prop is enabled.