mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
Panel: making sure we support all versions of chrome when detecting position of click event. (#29544)
* making sure we are always using int value when compairing coordinates. * removed unused import. * Using Math.floor instead. * removed unused dep.
This commit is contained in:
parent
db0fb1e2c1
commit
de395f24e4
@ -1,6 +1,5 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { isEqual } from 'lodash';
|
||||
import { DataLink, LoadingState, PanelData, PanelMenuItem, QueryResultMetaNotice, ScopedVars } from '@grafana/data';
|
||||
import { AngularComponent, config, getTemplateSrv } from '@grafana/runtime';
|
||||
import { ClickOutsideWrapper, Icon, IconName, Tooltip, stylesFactory } from '@grafana/ui';
|
||||
@ -52,8 +51,8 @@ export class PanelHeader extends PureComponent<Props, State> {
|
||||
|
||||
eventToClickCoordinates = (event: React.MouseEvent<HTMLDivElement>) => {
|
||||
return {
|
||||
x: event.clientX,
|
||||
y: event.clientY,
|
||||
x: Math.floor(event.clientX),
|
||||
y: Math.floor(event.clientY),
|
||||
};
|
||||
};
|
||||
|
||||
@ -62,7 +61,7 @@ export class PanelHeader extends PureComponent<Props, State> {
|
||||
};
|
||||
|
||||
isClick = (clickCoordinates: ClickCoordinates) => {
|
||||
return isEqual(clickCoordinates, this.clickCoordinates);
|
||||
return clickCoordinates.x === this.clickCoordinates.x && clickCoordinates.y === this.clickCoordinates.y;
|
||||
};
|
||||
|
||||
onMenuToggle = (event: React.MouseEvent<HTMLDivElement>) => {
|
||||
|
Loading…
Reference in New Issue
Block a user