Logs Popover Menu: close menu on right click (#78674)

LogRows: close menu on right click
This commit is contained in:
Matias Chomicki
2023-11-27 12:36:55 +00:00
committed by GitHub
parent 98c7c149cd
commit 5db420619d
@@ -121,6 +121,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
selectedRow: row,
});
document.addEventListener('click', this.handleDeselection);
document.addEventListener('contextmenu', this.handleDeselection);
return true;
};
@@ -138,6 +139,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
closePopoverMenu = () => {
document.removeEventListener('click', this.handleDeselection);
document.removeEventListener('contextmenu', this.handleDeselection);
this.setState({
selection: '',
popoverMenuCoordinates: { x: 0, y: 0 },
@@ -160,6 +162,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
componentWillUnmount() {
document.removeEventListener('click', this.handleDeselection);
document.removeEventListener('contextmenu', this.handleDeselection);
if (this.renderAllTimer) {
clearTimeout(this.renderAllTimer);
}