Skip to content

Commit

Permalink
Explore: Be sure time range key bindings are mounted after clear (#61892
Browse files Browse the repository at this point in the history
)

* Add list of bindings for updating on change

* Revert "Add list of bindings for updating on change"

This reverts commit 0927073.

* Clear keybindings before component render
  • Loading branch information
gelicia authored and baldm0mma committed Jan 26, 2023
1 parent c77ac38 commit c2279bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/app/core/navigation/GrafanaRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Suspense, useEffect } from 'react';
import React, { Suspense, useEffect, useLayoutEffect } from 'react';
// @ts-ignore
import Drop from 'tether-drop';

Expand All @@ -18,9 +18,11 @@ export function GrafanaRoute(props: Props) {

chrome.setMatchedRoute(props.route);

useEffect(() => {
useLayoutEffect(() => {
keybindings.clearAndInitGlobalBindings();
}, [keybindings]);

useEffect(() => {
updateBodyClassNames(props.route);
cleanupDOM();
navigationLogger('GrafanaRoute', false, 'Mounted', props.match);
Expand Down

0 comments on commit c2279bd

Please sign in to comment.