From ef37b78631480df3d6449ceaf5ac533baffae491 Mon Sep 17 00:00:00 2001 From: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Date: Wed, 8 May 2024 14:53:20 +0200 Subject: [PATCH] Revert "Panel: Keyboard focus shortcuts prioritization" (#87213) Revert "Panel: Keyboard focus shortcuts prioritization (#86772)" This reverts commit 3e450ec4bff3f971f6b885b6282bce8055a02a1b. --- public/app/core/services/withFocusedPanelId.ts | 8 -------- .../dashboard-scene/scene/keyboardShortcuts.ts | 10 ---------- 2 files changed, 18 deletions(-) diff --git a/public/app/core/services/withFocusedPanelId.ts b/public/app/core/services/withFocusedPanelId.ts index 9c67c0c71ca..857144ee706 100644 --- a/public/app/core/services/withFocusedPanelId.ts +++ b/public/app/core/services/withFocusedPanelId.ts @@ -2,14 +2,6 @@ export function withFocusedPanel(fn: (panelId: number) => void) { return () => { const elements = document.querySelectorAll(':hover'); - // Handle keyboard focus first - const focusedGridElement = document.activeElement?.closest('[data-panelid]'); - - if (focusedGridElement instanceof HTMLElement && focusedGridElement.dataset?.panelid) { - fn(parseInt(focusedGridElement.dataset?.panelid, 10)); - return; - } - for (let i = elements.length - 1; i > 0; i--) { const element = elements[i]; if (element instanceof HTMLElement && element.dataset?.panelid) { diff --git a/public/app/features/dashboard-scene/scene/keyboardShortcuts.ts b/public/app/features/dashboard-scene/scene/keyboardShortcuts.ts index 3a111f3421a..99123eaf9ca 100644 --- a/public/app/features/dashboard-scene/scene/keyboardShortcuts.ts +++ b/public/app/features/dashboard-scene/scene/keyboardShortcuts.ts @@ -146,16 +146,6 @@ export function setupKeyboardShortcuts(scene: DashboardScene) { export function withFocusedPanel(scene: DashboardScene, fn: (vizPanel: VizPanel) => void) { return () => { const elements = document.querySelectorAll(':hover'); - const focusedGridElement = document.activeElement?.closest('[data-viz-panel-key]'); - - if (focusedGridElement instanceof HTMLElement && focusedGridElement.dataset?.vizPanelKey) { - const panelKey = focusedGridElement.dataset?.vizPanelKey; - const vizPanel = sceneGraph.findObject(scene, (o) => o.state.key === panelKey); - if (vizPanel && vizPanel instanceof VizPanel) { - fn(vizPanel); - return; - } - } for (let i = elements.length - 1; i > 0; i--) { const element = elements[i];