mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: fix user select dialog change (#1184)
This commit is contained in:
1 parent
98538cafd7
commit
e86fab8387
1 file changed
+1
-1
@@ -220,7 +220,7 @@ export async function prompt<T extends string, R extends Record<T, Field>>(title
|
||||
: [selected[name].toString()])
|
||||
: []}
|
||||
onChange={(e) => {
|
||||
if (e === selected[name]) return;
|
||||
if (field.multi && e === selected[name]) return;
|
||||
const items = refs.current[name].getSelectedItems();
|
||||
const extract = (v) => (field.type === 'username' ? v?.uname : field.type === 'userId' ? v?._id : v);
|
||||
setValues({ ...values, [name]: field.multi ? items.map(extract) : extract(items[0]) });
|
||||
|
||||
Reference in new issue
Block a user