mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-02-06 09:55:47 +00:00
Update lib/src/Components/Input/Autocomplete.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
f53c02ead9
commit
a5f5ba738a
@ -110,7 +110,19 @@ export const Autocomplete = ({
|
||||
className={`tw:absolute tw:z-4000 ${filteredSuggestions.length > 0 ? 'tw:bg-base-100 tw:rounded-xl tw:p-2' : ''}`}
|
||||
>
|
||||
{filteredSuggestions.map((suggestion, index) => (
|
||||
<li key={suggestion.id} onClick={() => handleSuggestionClick(suggestion)}>
|
||||
<li
|
||||
key={suggestion.id}
|
||||
role="option"
|
||||
tabIndex={0}
|
||||
aria-selected={index === highlightedSuggestion}
|
||||
onClick={() => handleSuggestionClick(suggestion)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
handleSuggestionClick(suggestion);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<TagView heighlight={index === highlightedSuggestion} tag={suggestion}></TagView>
|
||||
</li>
|
||||
))}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user