mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 17:02:47 +00:00
dialog input autofocus
This commit is contained in:
@@ -18,6 +18,12 @@ class SetGroupQuotaDialog extends React.Component {
|
||||
quota: '',
|
||||
errMessage: '',
|
||||
};
|
||||
this.newInput = React.createRef();
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.newInput.focus();
|
||||
this.newInput.setSelectionRange(0, 0);
|
||||
}
|
||||
|
||||
setGroupQuota = () => {
|
||||
@@ -58,6 +64,7 @@ class SetGroupQuotaDialog extends React.Component {
|
||||
onKeyPress={this.handleKeyPress}
|
||||
value={this.state.quota}
|
||||
onChange={this.handleChange}
|
||||
innerRef={input => {this.newInput = input;}}
|
||||
/>
|
||||
<InputGroupAddon addonType="append">{'MB'}</InputGroupAddon>
|
||||
</InputGroup>
|
||||
|
Reference in New Issue
Block a user