Skip to content

Commit

Permalink
Merge pull request #28757 from allroundexperts/fix-28553
Browse files Browse the repository at this point in the history
fix: clear the input when resending validate code
  • Loading branch information
marcaaron authored Oct 6, 2023
2 parents 5c15272 + 060bf6d commit a0064a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ function BaseValidateCodeForm(props) {
if (!props.hasMagicCodeBeenSent) {
return;
}
setValidateCode('');
inputValidateCodeRef.current.clear();
}, [props.hasMagicCodeBeenSent]);

Expand All @@ -110,8 +109,7 @@ function BaseValidateCodeForm(props) {
*/
const resendValidateCode = () => {
User.requestContactMethodValidateCode(props.contactMethod);
setValidateCode('');
inputValidateCodeRef.current.focus();
inputValidateCodeRef.current.clear();
};

/**
Expand Down
1 change: 1 addition & 0 deletions src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ function BaseValidateCodeForm(props) {
*/
const resendValidateCode = () => {
User.resendValidateCode(props.credentials.login);
inputValidateCodeRef.current.clear();
// Give feedback to the user to let them know the email was sent so that they don't spam the button.
setTimeRemaining(30);
};
Expand Down

0 comments on commit a0064a9

Please sign in to comment.