mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 09:21:54 +00:00
add enter key handle
This commit is contained in:
@@ -61,6 +61,13 @@ class LibHistorySetting extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.submit();
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
onChange = (e) => {
|
||||
let num = e.target.value;
|
||||
this.setState({
|
||||
@@ -123,6 +130,7 @@ class LibHistorySetting extends React.Component {
|
||||
value={this.state.expireDays}
|
||||
onChange={this.onChange}
|
||||
disabled={this.state.disabled}
|
||||
onKeyDown={this.handleKeyPress}
|
||||
/>{' '}
|
||||
<Label><span>{gettext('days')}</span></Label>
|
||||
</FormGroup>
|
||||
|
Reference in New Issue
Block a user