mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: autocomplete: focus on the first item when !freeSolo (#381)
This commit is contained in:
1 parent
af19d83111
commit
dee229dcf3
1 file changed
+1
-1
@@ -121,7 +121,7 @@ const AutoComplete = forwardRef(function Impl<T>(props: AutoCompleteProps<T>, re
|
||||
if (!queryCache[query]) queryCache[query] = await queryItems(query);
|
||||
for (const item of queryCache[query]) valueCache[itemKey(item)] = item;
|
||||
setItemList(queryCache[query]);
|
||||
setCurrentItem(null);
|
||||
setCurrentItem((!freeSolo && queryCache[query].length > 0) ? 0 : null);
|
||||
};
|
||||
|
||||
const dispatchChange = () => {
|
||||
|
||||
Reference in new issue
Block a user