use default also when it doesn't contain a "##" (#29308)

fixes: #29263

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-05-07 09:46:20 +02:00 committed by GitHub
parent 2dcd05134e
commit 02cece07e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,7 +12,7 @@ import { useFormContext, useWatch } from "react-hook-form";
import { useTranslation } from "react-i18next";
function stringToMultiline(value?: string): string[] {
return typeof value === "string" ? value.split("##") : [""];
return typeof value === "string" ? value.split("##") : [value || ""];
}
function toStringValue(formValue: string[]): string {