better parsing of value and default value (#31110)
fixes: #31085 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
e99f99b8de
commit
64c6dc00c0
1 changed files with 8 additions and 7 deletions
|
@ -49,14 +49,15 @@ export const MultiLineInput = ({
|
|||
? stringToMultiline(
|
||||
Array.isArray(value) && value.length === 1 ? value[0] : value,
|
||||
)
|
||||
: value;
|
||||
: Array.isArray(value)
|
||||
? value
|
||||
: [value];
|
||||
|
||||
values =
|
||||
Array.isArray(values) && values.length !== 0
|
||||
? values
|
||||
: (stringify
|
||||
if (!Array.isArray(values) || values.length === 0) {
|
||||
values = (stringify
|
||||
? stringToMultiline(defaultValue as string)
|
||||
: defaultValue) || [""];
|
||||
}
|
||||
|
||||
return values;
|
||||
}, [value]);
|
||||
|
|
Loading…
Reference in a new issue