From 9ee0e09a5e16f6f8fb82e3f07b2daaac9cec742d Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 2 Jan 2020 00:46:38 +0200 Subject: [PATCH] Turn login div into form to allow using enter --- maubot/management/frontend/src/pages/Login.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/maubot/management/frontend/src/pages/Login.js b/maubot/management/frontend/src/pages/Login.js index ac9829e..640d0df 100644 --- a/maubot/management/frontend/src/pages/Login.js +++ b/maubot/management/frontend/src/pages/Login.js @@ -30,7 +30,8 @@ class Login extends Component { inputChanged = event => this.setState({ [event.target.name]: event.target.value }) - login = async () => { + login = async evt => { + evt.preventDefault() this.setState({ loading: true }) const resp = await api.login(this.state.username, this.state.password) if (resp.token) { @@ -53,17 +54,17 @@ class Login extends Component { } return
-
+

Maubot Manager

- {this.state.error &&
{this.state.error}
} -
+
} }