Skip to content

Commit

Permalink
Merge branch 'develop' into fix/custom-translations-text-wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
casalsgh authored Jun 16, 2023
2 parents 03b315a + ae39f91 commit 8fd7d58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/incomplete-emails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/web-ui-registration": patch
---

✅ Added a new email validation in the Registration Form
6 changes: 5 additions & 1 deletion packages/web-ui-registration/src/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,13 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo
<TextInput
{...register('email', {
required: true,
pattern: {
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
message: t('registration.component.form.invalidEmail'),
},
})}
placeholder={usernameOrEmailPlaceholder || t('registration.component.form.emailPlaceholder')}
error={errors.email && t('registration.component.form.requiredField')}
error={errors.email && t('registration.component.form.invalidEmail')}
name='email'
aria-invalid={errors.email ? 'true' : undefined}
id='email'
Expand Down

0 comments on commit 8fd7d58

Please sign in to comment.