mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logs popover: allow click listeners to run before closing the menu (#84583)
* Logs popover: allow click listeners to run before closing the menu * Decrease buffer time
This commit is contained in:
parent
200ff7f9b4
commit
bba1b12448
@ -147,7 +147,11 @@ class UnThemedLogRows extends PureComponent<Props, State> {
|
||||
if (document.getSelection()?.toString()) {
|
||||
return;
|
||||
}
|
||||
this.closePopoverMenu();
|
||||
// Give time to the browser to process click events originating from the menu before closing it.
|
||||
// Otherwise selectionchange fires before other click listeners, potentially skipping user actions.
|
||||
setTimeout(() => {
|
||||
this.closePopoverMenu();
|
||||
}, 100);
|
||||
};
|
||||
|
||||
closePopoverMenu = () => {
|
||||
@ -177,6 +181,7 @@ class UnThemedLogRows extends PureComponent<Props, State> {
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener('click', this.handleDeselection);
|
||||
document.removeEventListener('contextmenu', this.handleDeselection);
|
||||
document.removeEventListener('selectionchange', this.handleDeselection);
|
||||
if (this.renderAllTimer) {
|
||||
clearTimeout(this.renderAllTimer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user