fix
This commit is contained in:
parent
dc05e278c4
commit
d1de16a753
|
|
@ -25,6 +25,7 @@ export const TypeDropdown: FC<{
|
|||
: fm.data[field.name];
|
||||
|
||||
useEffect(() => {
|
||||
if (isEditor) return;
|
||||
if (typeof arg.on_load === "function") {
|
||||
const options = arg.on_load({ field });
|
||||
if (options instanceof Promise) {
|
||||
|
|
@ -57,11 +58,8 @@ export const TypeDropdown: FC<{
|
|||
})
|
||||
: fm.data[field.name];
|
||||
|
||||
if (
|
||||
field.type === "single-option" &&
|
||||
!value &&
|
||||
local.options.length > 0
|
||||
) {
|
||||
if (field.type === "single-option") {
|
||||
if (!value && local.options.length > 0) {
|
||||
arg.opt_set_value({
|
||||
fm,
|
||||
name: field.name,
|
||||
|
|
@ -69,7 +67,7 @@ export const TypeDropdown: FC<{
|
|||
options: local.options,
|
||||
selected: [local.options[0]?.value],
|
||||
});
|
||||
} else if (field.type === "single-option" && value) {
|
||||
} else if ( value) {
|
||||
arg.opt_set_value({
|
||||
fm,
|
||||
name: field.name,
|
||||
|
|
@ -78,6 +76,7 @@ export const TypeDropdown: FC<{
|
|||
selected: [value],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
local.loaded = true;
|
||||
local.render();
|
||||
|
|
@ -141,8 +140,6 @@ export const TypeDropdown: FC<{
|
|||
});
|
||||
}
|
||||
|
||||
fm.data[field.name] = item?.value;
|
||||
|
||||
return item?.value || search;
|
||||
}}
|
||||
disabled={disabled}
|
||||
|
|
|
|||
Loading…
Reference in New Issue