Skip to content

Commit

Permalink
Merge pull request #6723 from parasharrajat/loginform
Browse files Browse the repository at this point in the history
Clean Old password when user click goBack
  • Loading branch information
mountiny authored Dec 12, 2021
2 parents d827b9b + dc3104a commit 2ecdbbc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/pages/signin/PasswordForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,19 @@ class PasswordForm extends React.Component {
}

componentDidUpdate(prevProps) {
if (prevProps.isVisible || !this.props.isVisible) {
return;
if (!prevProps.isVisible && this.props.isVisible) {
this.input.focus();
}
this.input.focus();
if (prevProps.isVisible && !this.props.isVisible && this.state.password) {
this.clearPassword();
}
}

/**
* Clear Password from the state
*/
clearPassword() {
this.setState({password: ''}, this.input.clear);
}

/**
Expand Down

0 comments on commit 2ecdbbc

Please sign in to comment.