web/ui: Hitting enter on range input creates a new query (#8581)

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
pull/8587/head
Matthias Loibl 2021-03-11 14:37:26 +01:00 committed by GitHub
parent 3e17eaada5
commit 369aae93a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -101,6 +101,9 @@ class GraphControls extends Component<GraphControlsProps> {
defaultValue={formatDuration(this.props.range)}
innerRef={this.rangeRef}
onBlur={() => this.onChangeRangeInput(this.rangeRef.current!.value)}
onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) =>
e.key === 'Enter' && this.onChangeRangeInput(this.rangeRef.current!.value)
}
/>
<InputGroupAddon addonType="append">