Variables: Prevents enter key from refreshing page or changing focus (#39666)

This commit is contained in:
Hugo Häggmark
2021-09-28 06:07:03 +02:00
committed by GitHub
parent 2d616285d9
commit 9a178e7ba9

View File

@@ -46,6 +46,7 @@ export function TextBoxVariablePicker({ variable, onVariableChange }: Props): Re
const onBlur = (e: FocusEvent<HTMLInputElement>) => updateVariable();
const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {
if (event.keyCode === 13) {
event.preventDefault();
updateVariable();
}
};