1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-11 20:01:10 +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

@@ -23,11 +23,6 @@ class SearchFileDialog extends React.Component {
errMessage: '',
fileList: null
};
this.inputRef = React.createRef();
}
componentDidMount() {
this.inputRef.current.focus();
}
searchFile = () => {
@@ -78,11 +73,11 @@ class SearchFileDialog extends React.Component {
render() {
const { q, errMessage, fileList, isSubmitDisabled, isSubmitting } = this.state;
return (
<Modal isOpen={true} toggle={this.toggle}>
<Modal isOpen={true} toggle={this.toggle} autoFocus={false}>
<ModalHeader toggle={this.toggle}>{gettext('Search')}</ModalHeader>
<ModalBody style={{height: '250px'}} className="o-auto">
<div className="d-flex">
<input className="form-control mr-2" type="text" placeholder={gettext('Search files in this library')} value={q} onChange={this.handleInputChange} onKeyDown={this.handleKeyDown} ref={this.inputRef} />
<input className="form-control mr-2" type="text" placeholder={gettext('Search files in this library')} value={q} onChange={this.handleInputChange} onKeyDown={this.handleKeyDown} autoFocus={true} />
<button type="submit" className={`btn btn-primary flex-shrink-0 ${isSubmitting ? 'btn-loading' : ''}`} onClick={this.searchFile} disabled={isSubmitDisabled}>{gettext('Search')}</button>
</div>
{errMessage && <Alert color="danger" className="mt-2">{errMessage}</Alert>}