mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix: closing workspace menu after clicking on iframe (#2349)
This commit is contained in:
1 parent
df2d79173f
commit
ca39379b3a
4 files changed
+13
-5
No files matched your search
@@ -82,6 +82,7 @@ export class Menu extends React.Component<MenuProps, State> {
|
||||
window.addEventListener("click", this.onClickOutside, true);
|
||||
window.addEventListener("scroll", this.onScrollOutside, true);
|
||||
window.addEventListener("contextmenu", this.onContextMenu, true);
|
||||
window.addEventListener("blur", this.onBlur, true);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -232,6 +233,12 @@ export class Menu extends React.Component<MenuProps, State> {
|
||||
}
|
||||
}
|
||||
|
||||
onBlur() {
|
||||
if (document.activeElement?.tagName == "IFRAME") {
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
|
||||
protected bindRef(elem: HTMLUListElement) {
|
||||
this.elem = elem;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user