From 711c50c609a8fd3d527a4ef1f474c8f1fce55e91 Mon Sep 17 00:00:00 2001 From: Aaron Yu Date: Sun, 4 Sep 2022 18:25:37 +0800 Subject: [PATCH] add keydown --- src/App.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/App.js b/src/App.js index bee96bb..f8f8285 100644 --- a/src/App.js +++ b/src/App.js @@ -199,6 +199,7 @@ class App extends React.Component { value={loginForm.account} variant="standard" onChange={(e) => this.setLoginForm({ account: e.target.value })} + onKeyDown={(e) => e.keyCode == 13 && this.login()} /> this.setLoginForm({ password: e.target.value })} + onKeyDown={(e) => e.keyCode == 13 && this.login()} />