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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();
}
};