Skip to content

Conversation

@MarioLeandro
Copy link
Member

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

  • A visual marker has been added for the selected item, which persists when the menu reopens. Additionally, the aria-selected attribute 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.
  • The same visual improvement also applies to the MultiSelect component that uses Autocomplete.
  • A test for visual feedback has been added, and tests that used the old aria-selected behavior have been modified to match the new version.
  • The documentation was updated as well

1. Selected State - Autocomplete

image

Show the visual feedback for selected items.

1. Selected State - Multiselect

image

Show the visual feedback for selected items.

1. selectedKeys(clayui.com) Example - Autocomplete

image

Show the visual feedback for selected items.

1. API Reference - Autocomplete

image image

The new properties added.

@vercel
Copy link

vercel bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clayui.com Ready Ready Preview Comment Nov 14, 2025 2:15pm
storybook.clayui.com Ready Ready Preview Comment Nov 14, 2025 2:15pm


/**
* Flag that indicates if item is selected.
* @deprecated since v3.151.0 - uses the `selectedKeys` property on the
Copy link
Member Author

@MarioLeandro MarioLeandro Nov 13, 2025

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 ?

Copy link
Member

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

@MarioLeandro
Copy link
Member Author

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
Copy link
Member

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

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.

3 participants