1
0
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:
Alex Andreev 2021-03-17 18:31:34 +03:00 committed by GitHub
parent df2d79173f
commit ca39379b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View File

@ -11,10 +11,6 @@
grid-area: main;
position: relative;
display: flex;
> * {
z-index: 1;
}
}
.ClustersMenu {
@ -33,6 +29,7 @@
bottom: 0;
display: flex;
background-color: $mainBackground;
z-index: 1;
iframe {
flex: 1;

View File

@ -61,3 +61,7 @@
}
}
}
.Menu.WorkspaceMenu {
z-index: 2; // Place behind Preferences, Extension pages etc...
}

View File

@ -31,7 +31,7 @@
// covers whole app view area
&.showOnTop {
position: fixed !important; // allow to cover ClustersMenu
z-index: 1;
z-index: 3;
left: 0;
top: 0;
right: 0;

View File

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