From 31a42de2901f9c154b8d0bd41edbc6011a7fcad1 Mon Sep 17 00:00:00 2001 From: Sam Hariri <137707942+samh-nl@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:15:04 +0200 Subject: [PATCH] fix: added maxLength to login and contact inputs --- src/CONST.js | 1 + src/pages/settings/Profile/Contacts/NewContactMethodPage.js | 1 + src/pages/signin/LoginForm.js | 1 + 3 files changed, 3 insertions(+) diff --git a/src/CONST.js b/src/CONST.js index 88282c4b68e4..ea518ca5c021 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1247,6 +1247,7 @@ const CONST = { FORM_CHARACTER_LIMIT: 50, LEGAL_NAMES_CHARACTER_LIMIT: 150, + LOGIN_CHARACTER_LIMIT: 254, WORKSPACE_NAME_CHARACTER_LIMIT: 80, AVATAR_CROP_MODAL: { // The next two constants control what is min and max value of the image crop scale. diff --git a/src/pages/settings/Profile/Contacts/NewContactMethodPage.js b/src/pages/settings/Profile/Contacts/NewContactMethodPage.js index e9bfbd2f84f1..8a85c6857661 100644 --- a/src/pages/settings/Profile/Contacts/NewContactMethodPage.js +++ b/src/pages/settings/Profile/Contacts/NewContactMethodPage.js @@ -149,6 +149,7 @@ function NewContactMethodPage(props) { inputID="phoneOrEmail" autoCapitalize="none" returnKeyType={Permissions.canUsePasswordlessLogins(props.betas) ? 'done' : 'next'} + maxLength={CONST.LOGIN_CHARACTER_LIMIT} /> {!Permissions.canUsePasswordlessLogins(props.betas) && ( diff --git a/src/pages/signin/LoginForm.js b/src/pages/signin/LoginForm.js index 88df88155eed..1200bb5e4887 100644 --- a/src/pages/signin/LoginForm.js +++ b/src/pages/signin/LoginForm.js @@ -192,6 +192,7 @@ function LoginForm(props) { keyboardType={CONST.KEYBOARD_TYPE.EMAIL_ADDRESS} errorText={formErrorText} hasError={hasError} + maxLength={CONST.LOGIN_CHARACTER_LIMIT} /> {!_.isEmpty(props.account.success) && {props.account.success}}