From 9a178e7ba96c31be794e712bb098c7aa60309564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Tue, 28 Sep 2021 06:07:03 +0200 Subject: [PATCH] Variables: Prevents enter key from refreshing page or changing focus (#39666) --- public/app/features/variables/textbox/TextBoxVariablePicker.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/public/app/features/variables/textbox/TextBoxVariablePicker.tsx b/public/app/features/variables/textbox/TextBoxVariablePicker.tsx index 88ea0c7a501..d1368b5f7b9 100644 --- a/public/app/features/variables/textbox/TextBoxVariablePicker.tsx +++ b/public/app/features/variables/textbox/TextBoxVariablePicker.tsx @@ -46,6 +46,7 @@ export function TextBoxVariablePicker({ variable, onVariableChange }: Props): Re const onBlur = (e: FocusEvent) => updateVariable(); const onKeyDown = (event: KeyboardEvent) => { if (event.keyCode === 13) { + event.preventDefault(); updateVariable(); } };