add keydown

master
Aaron Yu 2022-09-04 18:25:37 +08:00
parent 9a52b3dd47
commit 711c50c609
1 changed files with 2 additions and 0 deletions

View File

@ -199,6 +199,7 @@ class App extends React.Component {
value={loginForm.account} value={loginForm.account}
variant="standard" variant="standard"
onChange={(e) => this.setLoginForm({ account: e.target.value })} onChange={(e) => this.setLoginForm({ account: e.target.value })}
onKeyDown={(e) => e.keyCode == 13 && this.login()}
/> />
<TextField <TextField
autoFocus autoFocus
@ -210,6 +211,7 @@ class App extends React.Component {
value={loginForm.password} value={loginForm.password}
variant="standard" variant="standard"
onChange={(e) => this.setLoginForm({ password: e.target.value })} onChange={(e) => this.setLoginForm({ password: e.target.value })}
onKeyDown={(e) => e.keyCode == 13 && this.login()}
/> />
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>