Merge pull request #3416 from benjiwheeler/join-flow-show-password-default

change password default; remove unused state var
This commit is contained in:
Benjamin Wheeler 2019-09-30 16:43:50 -04:00 committed by GitHub
commit aabdd128f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,6 @@ class UsernameStep extends React.Component {
constructor (props) {
super(props);
bindAll(this, [
'handleChangeShowPassword',
'handleFocused',
'handleSetUsernameRef',
'handleValidSubmit',
@ -30,17 +29,13 @@ class UsernameStep extends React.Component {
'validateForm'
]);
this.state = {
focused: null,
showPassword: false
focused: null
};
}
componentDidMount () {
// automatically start with focus on username field
if (this.usernameInput) this.usernameInput.focus();
}
handleChangeShowPassword () {
this.setState({showPassword: !this.state.showPassword});
}
// track the currently focused input field, to determine whether each field should
// display a tooltip. (We only display it if a field is focused and has never been touched.)
handleFocused (fieldName) {
@ -114,7 +109,7 @@ class UsernameStep extends React.Component {
username: '',
password: '',
passwordConfirm: '',
showPassword: false
showPassword: true
}}
validate={this.validateForm}
validateOnBlur={false}