ui: problemconfig: fix extra_files autocomplete

This commit is contained in:
undefined committed 2023-03-16 19:25:22 +08:00
1 parent ed34f6eb13
commit 4d766baf54
2 files changed
+7 -3

No files matched your search

@@ -128,9 +128,12 @@ const AutoComplete = forwardRef(function Impl<T>(props: AutoCompleteProps<T>, re
setCurrentItem((!freeSolo && queryCache[query].length > 0) ? 0 : null);
};
useEffect(() => {
setSelectedKeys(props.selectedKeys || []);
}, [JSON.stringify(props.selectedKeys)]);
const dispatchChange = () => {
if (!multi) onChange(inputRef.current?.value);
else onChange([...selectedKeys, inputRef.current?.value].filter((v) => v?.trim().length > 0).join(','));
else onChange(selectedKeys.filter((v) => v?.trim().length > 0).join(','));
};
let first = !multi;