mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: fix selectUser (#1031)
This commit is contained in:
5 files changed
+30
-19
No files matched your search
@@ -126,10 +126,8 @@ const AutoComplete = forwardRef(function Impl<T>(props: AutoCompleteProps<T>, re
|
||||
else onChange(selectedKeys.filter((v) => v?.trim().length).join(','));
|
||||
};
|
||||
|
||||
let first = !multi;
|
||||
useEffect(() => {
|
||||
if (first) first = false;
|
||||
else dispatchChange();
|
||||
dispatchChange();
|
||||
if (!multi) return; // Load pre-selected items only in multi mode
|
||||
const ids = [];
|
||||
for (const key of selectedKeys) if (!valueCache[key]) ids.push(key);
|
||||
@@ -161,7 +159,6 @@ const AutoComplete = forwardRef(function Impl<T>(props: AutoCompleteProps<T>, re
|
||||
setSelectedKeys([key]);
|
||||
inputRef.current.value = key;
|
||||
}
|
||||
dispatchChange();
|
||||
if (!shouldKeepOpen) {
|
||||
setItemList([]);
|
||||
setCurrentItem(null);
|
||||
|
||||
Reference in new issue
Block a user