mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variables: Prevents enter key from refreshing page or changing focus (#39666)
This commit is contained in:
parent
2d616285d9
commit
9a178e7ba9
@ -46,6 +46,7 @@ export function TextBoxVariablePicker({ variable, onVariableChange }: Props): Re
|
|||||||
const onBlur = (e: FocusEvent<HTMLInputElement>) => updateVariable();
|
const onBlur = (e: FocusEvent<HTMLInputElement>) => updateVariable();
|
||||||
const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
|
const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
|
||||||
if (event.keyCode === 13) {
|
if (event.keyCode === 13) {
|
||||||
|
event.preventDefault();
|
||||||
updateVariable();
|
updateVariable();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user