mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logs Popover Menu: close menu on right click (#78674)
LogRows: close menu on right click
This commit is contained in:
parent
98c7c149cd
commit
5db420619d
@ -121,6 +121,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
|
|||||||
selectedRow: row,
|
selectedRow: row,
|
||||||
});
|
});
|
||||||
document.addEventListener('click', this.handleDeselection);
|
document.addEventListener('click', this.handleDeselection);
|
||||||
|
document.addEventListener('contextmenu', this.handleDeselection);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -138,6 +139,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
|
|||||||
|
|
||||||
closePopoverMenu = () => {
|
closePopoverMenu = () => {
|
||||||
document.removeEventListener('click', this.handleDeselection);
|
document.removeEventListener('click', this.handleDeselection);
|
||||||
|
document.removeEventListener('contextmenu', this.handleDeselection);
|
||||||
this.setState({
|
this.setState({
|
||||||
selection: '',
|
selection: '',
|
||||||
popoverMenuCoordinates: { x: 0, y: 0 },
|
popoverMenuCoordinates: { x: 0, y: 0 },
|
||||||
@ -160,6 +162,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
|
|||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
document.removeEventListener('click', this.handleDeselection);
|
document.removeEventListener('click', this.handleDeselection);
|
||||||
|
document.removeEventListener('contextmenu', this.handleDeselection);
|
||||||
if (this.renderAllTimer) {
|
if (this.renderAllTimer) {
|
||||||
clearTimeout(this.renderAllTimer);
|
clearTimeout(this.renderAllTimer);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user