-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 <InputEmail> Fix valid emails not being validated
- Loading branch information
Showing
2 changed files
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<script lang="ts"> | ||
import { z } from 'zod'; | ||
import BaseInputText from './BaseInputText.svelte'; | ||
import { EMAIL_REGEX } from './types'; | ||
export let id: string | undefined = undefined; | ||
export let name: string | undefined = undefined; | ||
|
@@ -10,7 +11,10 @@ | |
export let unit: string = ''; | ||
export let suggestions: string[] | undefined = undefined; | ||
export let required: boolean = false; | ||
export let schema: Zod.ZodString = z.string().email({ message: 'Adresse e-mail invalide' }); | ||
export let schema: Zod.ZodString = z.string().regex(EMAIL_REGEX, { | ||
message: 'Adresse email invalide' | ||
}); /* don't use .email() until https://github.com/colinhacks/zod/pull/2224 gets merged, [email protected] does not pass!!!! */ | ||
</script> | ||
|
||
<BaseInputText | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters