From eb5c15a870511ec79088d04e7ff14ff054226d72 Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Sat, 8 Jun 2024 01:40:03 +0300 Subject: [PATCH] update email pattern for newer browser versions using v flag in regex patterns --- src/components/ProtocolForm.js | 2 +- src/components/ViolationForm.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ProtocolForm.js b/src/components/ProtocolForm.js index 5aad239..4d7fbdc 100644 --- a/src/components/ProtocolForm.js +++ b/src/components/ProtocolForm.js @@ -188,7 +188,7 @@ export const ProtocolForm = () => { required={true} value={email} autoComplete="email" - pattern="^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" + pattern="[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~\-]+@[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*" title="Въведете валиден имейл адрес" placeholder="Имейл адрес" onChange={(e) => setEmail(e.target.value)} diff --git a/src/components/ViolationForm.js b/src/components/ViolationForm.js index 337dc40..8737888 100644 --- a/src/components/ViolationForm.js +++ b/src/components/ViolationForm.js @@ -192,7 +192,7 @@ export const ViolationForm = () => { label="Имейл" type="email" autoComplete="email" - pattern="^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" + pattern="[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~\-]+@[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*" title="Въведете валиден имейл адрес" register={register} errors={errors}