Introduce an onUsernameBlur and fix hostname parsing

This commit is contained in:
Travis Ralston 2018-11-21 14:13:56 -07:00
parent 6f0f930e0a
commit 4cfefe4c3c
3 changed files with 21 additions and 5 deletions

View file

@ -30,6 +30,7 @@ class PasswordLogin extends React.Component {
static defaultProps = {
onError: function() {},
onUsernameChanged: function() {},
onUsernameBlur: function() {},
onPasswordChanged: function() {},
onPhoneCountryChanged: function() {},
onPhoneNumberChanged: function() {},
@ -122,11 +123,11 @@ class PasswordLogin extends React.Component {
onUsernameChanged(ev) {
this.setState({username: ev.target.value});
this.props.onUsernameChanged(ev.target.value, false);
this.props.onUsernameChanged(ev.target.value);
}
onUsernameBlur(ev) {
this.props.onUsernameChanged(this.state.username, true);
this.props.onUsernameBlur(this.state.username);
}
onLoginTypeChange(loginType) {