From 3ac5dfec42be2370899f490ebc1303f965e4957a Mon Sep 17 00:00:00 2001 From: Kristina Date: Mon, 25 Jul 2022 14:21:24 -0500 Subject: [PATCH] Only reset keybindings on route change, not param change (#52746) --- public/app/core/navigation/GrafanaRoute.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/app/core/navigation/GrafanaRoute.tsx b/public/app/core/navigation/GrafanaRoute.tsx index aea63ce904e..cc53312488c 100644 --- a/public/app/core/navigation/GrafanaRoute.tsx +++ b/public/app/core/navigation/GrafanaRoute.tsx @@ -19,9 +19,6 @@ export function GrafanaRoute(props: Props) { updateBodyClassNames(props.route); cleanupDOM(); - // unbinds all and re-bind global keybindins - keybindingSrv.reset(); - keybindingSrv.initGlobals(); reportPageview(); navigationLogger('GrafanaRoute', false, 'Mounted', props.match); @@ -31,6 +28,12 @@ export function GrafanaRoute(props: Props) { }; }, [chrome, props.route, props.match]); + useEffect(() => { + // unbinds all and re-bind global keybindins + keybindingSrv.reset(); + keybindingSrv.initGlobals(); + }, [chrome, props.route]); + useEffect(() => { cleanupDOM(); reportPageview();