Fix Vector getValues (#7071)

This commit is contained in:
Jaco 2022-02-28 14:12:16 +01:00 committed by GitHub
parent 0f14ce32a0
commit 03cf9b49de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,11 +36,13 @@ export function getParams (inputParams: ParamDef[], prev: ParamDef[], max: numbe
}
export function getValues ({ value }: RawParam): RawParam[] {
return (value as RawParam[] || []).map((value: RawParam) =>
isUndefined(value) || isUndefined(value.isValid)
? { isValid: !isUndefined(value), value }
: value
);
return Array.isArray(value)
? value.map((value: RawParam) =>
isUndefined(value) || isUndefined(value.isValid)
? { isValid: !isUndefined(value), value }
: value
)
: [];
}
function Vector ({ className = '', defaultValue, isDisabled = false, label, onChange, overrides, registry, type, withLabel }: Props): React.ReactElement<Props> | null {