1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 07:55:36 +00:00

[keypress] replaced 'onKeyPress' with 'onKeyDown' as 'keypress' is de… (#5764)

* [keypress] replaced 'onKeyPress' with 'onKeyDown' as 'keypress' is deprecated

* cleaned up code
This commit is contained in:
llj
2023-11-14 20:25:25 +08:00
committed by GitHub
parent c6862887bd
commit a4e2e4aba4
32 changed files with 60 additions and 74 deletions

View File

@@ -46,7 +46,7 @@ class SetGroupQuotaDialog extends React.Component {
this.setState({ quota: quota });
};
handleKeyPress = (e) => {
handleKeyDown = (e) => {
if (e.key === 'Enter') {
this.setGroupQuota();
e.preventDefault();
@@ -60,7 +60,7 @@ class SetGroupQuotaDialog extends React.Component {
<ModalBody>
<InputGroup>
<Input
onKeyPress={this.handleKeyPress}
onKeyDown={this.handleKeyDown}
value={this.state.quota}
onChange={this.handleChange}
autoFocus={true}