1
0
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:
shanshuirenjia
2019-07-02 13:23:46 +08:00
parent 0183221575
commit 2bbdaff4de

View File

@@ -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>