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 13:36:55 +01:00 committed by GitHub
parent 98c7c149cd
commit 5db420619d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}