mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +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:
@@ -57,7 +57,7 @@ class CreateRepoDialog extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -180,7 +180,7 @@ class CreateRepoDialog extends React.Component {
|
||||
<Label for="repoName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="repoName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
value={this.state.repoName}
|
||||
onChange={this.handleRepoNameChange}
|
||||
autoFocus={true}
|
||||
|
Reference in New Issue
Block a user