PanelShortcuts: Set attention onMouseEnter (#90435)

Add onMouseEnter to PanelChrome
This commit is contained in:
Tobias Skarhed 2024-07-16 09:03:38 +02:00 committed by GitHub
parent 118597d80f
commit 4c9cb63823
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -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}
>
<div className={styles.loadingBarContainer}>

View File

@ -589,6 +589,7 @@ export class PanelStateWrapper extends PureComponent<Props, State> {
onCancelQuery={panelChromeProps.onCancelQuery}
onOpenMenu={panelChromeProps.onOpenMenu}
onFocus={() => this.setPanelAttention()}
onMouseEnter={() => this.setPanelAttention()}
onMouseMove={() => this.debouncedSetPanelAttention()}
>
{(innerWidth, innerHeight) => (