fix(email-form): filter out empty emails
This commit is contained in:
parent
a16681a096
commit
83b0602417
1 changed files with 8 additions and 1 deletions
|
|
@ -93,7 +93,14 @@ export const EmailForm = ({ form }: Props) => {
|
||||||
{...field}
|
{...field}
|
||||||
placeholder="user@example.com, admin@example.com"
|
placeholder="user@example.com, admin@example.com"
|
||||||
value={Array.isArray(field.value) ? field.value.join(", ") : ""}
|
value={Array.isArray(field.value) ? field.value.join(", ") : ""}
|
||||||
onChange={(e) => field.onChange(e.target.value.split(",").map((email) => email.trim()))}
|
onChange={(e) =>
|
||||||
|
field.onChange(
|
||||||
|
e.target.value
|
||||||
|
.split(",")
|
||||||
|
.map((email) => email.trim())
|
||||||
|
.filter(Boolean),
|
||||||
|
)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>Comma-separated list of recipient email addresses.</FormDescription>
|
<FormDescription>Comma-separated list of recipient email addresses.</FormDescription>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue