Only reset keybindings on route change, not param change (#52746)

This commit is contained in:
Kristina
2022-07-25 14:21:24 -05:00
committed by GitHub
parent 0e13ee345d
commit 3ac5dfec42
+6 -3
View File
@@ -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();