mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Handling onBlur event to detect iframe click
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
1aff341f0e
commit
51c5ecab2d
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user