Only trigger blur action when clicking either iframe or body
This commit is contained in:
parent
12ae35c16d
commit
a64e0311d8
|
@ -93,9 +93,14 @@ const handleMouseDown = (e: MouseEvent) => {
|
|||
|
||||
// Handle iframe clicks by detecting a loss of focus on the main window
|
||||
const handleBlur = () => {
|
||||
handleClick(
|
||||
new MouseEvent("click", { relatedTarget: document.activeElement })
|
||||
)
|
||||
if (
|
||||
document.activeElement &&
|
||||
["IFRAME", "BODY"].includes(document.activeElement.tagName)
|
||||
) {
|
||||
handleClick(
|
||||
new MouseEvent("click", { relatedTarget: document.activeElement })
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Global singleton listeners for our events
|
||||
|
|
Loading…
Reference in New Issue