mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 19:08:21 +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:
@@ -67,7 +67,7 @@ class CreateFile extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
handleKeyDown = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleSubmit();
|
||||
e.preventDefault();
|
||||
@@ -151,7 +151,7 @@ class CreateFile extends React.Component {
|
||||
<Label for="fileName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="fileName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
innerRef={this.newInput}
|
||||
value={this.state.childName}
|
||||
onChange={this.handleChange}
|
||||
|
Reference in New Issue
Block a user