sign-in: never visually show a uppercase character in a username

This commit is contained in:
@wwwjim 2020-09-02 09:28:49 -07:00
parent c8591afaad
commit 1eb59f4b53

View File

@ -112,6 +112,10 @@ export default class SceneSignIn extends React.Component {
this.setState({ [e.target.name]: e.target.value });
};
_handleUsernameChange = (e) => {
this.setState({ [e.target.name]: e.target.value.toLowerCase() });
};
_handleSubmit = async () => {
this.setState({ loading: true });
@ -155,7 +159,7 @@ export default class SceneSignIn extends React.Component {
this.setState({ loading: true });
const response = await Actions.checkUsername({
username: this.state.username,
username: this.state.username.toLowerCase(),
});
if (!response) {
@ -205,7 +209,7 @@ export default class SceneSignIn extends React.Component {
name="username"
type="text"
value={this.state.username}
onChange={this._handleChange}
onChange={this._handleUsernameChange}
onSubmit={this._handleCheckUsername}
/>