1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 19:08:21 +00:00

Update dependency 3 (#5344)

* update react react-dom prop-types

* update seafile-editor version

* install deep-copy denpendency

* update router version

* repair focus bug

* optimize code

* optimize code
This commit is contained in:
杨顺强
2022-12-24 10:41:34 +08:00
committed by GitHub
parent bf313b947c
commit 3faa4acb8e
70 changed files with 669 additions and 1297 deletions

View File

@@ -32,8 +32,6 @@ class CreateFile extends React.Component {
} else {
this.setState({parentPath: parentPath + '/'}); // sidePanel
}
this.newInput.focus();
this.newInput.setSelectionRange(0,0);
}
handleChange = (e) => {
@@ -132,9 +130,15 @@ class CreateFile extends React.Component {
return isDuplicated;
}
onAfterModelOpened = () => {
if (!this.newInput.current) return;
this.newInput.current.focus();
this.newInput.current.setSelectionRange(0,0);
}
render() {
return (
<Modal isOpen={true} toggle={this.toggle}>
<Modal isOpen={true} toggle={this.toggle} onOpened={this.onAfterModelOpened}>
<ModalHeader toggle={this.toggle}>{gettext('New File')}</ModalHeader>
<ModalBody>
<Form>
@@ -143,7 +147,7 @@ class CreateFile extends React.Component {
<Input
id="fileName"
onKeyPress={this.handleKeyPress}
innerRef={input => {this.newInput = input;}}
innerRef={this.newInput}
value={this.state.childName}
onChange={this.handleChange}
/>