From 4c9cb638232f9551f5ec1cefa5c8b784bedb2064 Mon Sep 17 00:00:00 2001 From: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:03:38 +0200 Subject: [PATCH] PanelShortcuts: Set attention onMouseEnter (#90435) Add onMouseEnter to PanelChrome --- packages/grafana-ui/src/components/PanelChrome/PanelChrome.tsx | 3 +++ public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.tsx b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.tsx index 4928c84fd3f..e50f103339f 100644 --- a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.tsx +++ b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.tsx @@ -65,6 +65,7 @@ interface BaseProps { * Debounce the event handler, if possible */ onMouseMove?: () => void; + onMouseEnter?: () => void; } interface FixedDimensions extends BaseProps { @@ -132,6 +133,7 @@ export function PanelChrome({ onToggleCollapse, onFocus, onMouseMove, + onMouseEnter, }: PanelChromeProps) { const theme = useTheme2(); const styles = useStyles2(getStyles); @@ -262,6 +264,7 @@ export function PanelChrome({ tabIndex={0} // eslint-disable-line jsx-a11y/no-noninteractive-tabindex onFocus={onFocus} onMouseMove={onMouseMove} + onMouseEnter={onMouseEnter} ref={ref} >
diff --git a/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx b/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx index c1eb01e3b11..7ae7c5a33ae 100644 --- a/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx +++ b/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx @@ -589,6 +589,7 @@ export class PanelStateWrapper extends PureComponent { onCancelQuery={panelChromeProps.onCancelQuery} onOpenMenu={panelChromeProps.onOpenMenu} onFocus={() => this.setPanelAttention()} + onMouseEnter={() => this.setPanelAttention()} onMouseMove={() => this.debouncedSetPanelAttention()} > {(innerWidth, innerHeight) => (