-
Notifications
You must be signed in to change notification settings - Fork 515
feat(@clayui/autocomplete): LPD-66892 Add selectedKeys prop to improve selected state #6208
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
base: master
Are you sure you want to change the base?
Conversation
…iSelect Autocomplete
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
||
| /** | ||
| * Flag that indicates if item is selected. | ||
| * @deprecated since v3.151.0 - uses the `selectedKeys` property on the |
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.
@ethib137 The version here should be the one from clay-autocomplete/package.json ?
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.
@MarioLeandro yes this is correct
…hat were using the old aria-selected behavior
…button' instead of 'li'
… is selected test
…erty to accept options of type number
…ibility to Autocomplete.Item
…ls selected state feedback only if selectedKeys is defined and includes the item
…yAutocomplete.Item because it is no longer needed due to the use of `selectKeys` in the root component.
fce7634 to
07092ae
Compare
|
Hey @limaagabriel. I've implemented some changes based on your feedback. Let me know what you think. |
|
|
||
| /** | ||
| * Flag that indicates if item is selected. | ||
| * @deprecated since v3.151.0 - uses the `selectedKeys` property on the |
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.
@MarioLeandro yes this is correct
JIRA-Ticket: https://liferay.atlassian.net/browse/LPD-66892
Motivation
Currently, the Autocomplete does not provide a clear selected state in its menu. Unlike the Picker (which uses a dark check), users cannot visually confirm which item is active once the menu is open. This creates confusion, especially when dealing with long lists of items.
Solution
aria-selectedattribute is now linked to whether the item is selected or not, and no longer to whether the item is in focus. This change follows the item pattern of the Picker component.aria-selectedbehavior have been modified to match the new version.1. Selected State - Autocomplete
Show the visual feedback for selected items.
1. Selected State - Multiselect
Show the visual feedback for selected items.
1. selectedKeys(clayui.com) Example - Autocomplete
Show the visual feedback for selected items.
1. API Reference - Autocomplete
The new properties added.