Merge pull request #15517 from Budibase/BUDI-9016/fix-clickoutside-on-firefox

Fix clickoutside on firefox
This commit is contained in:
Adria Navarro 2025-02-11 13:11:59 +01:00 committed by GitHub
commit 72f8a3faea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -93,7 +93,10 @@ const handleMouseDown = (e: MouseEvent) => {
// Handle iframe clicks by detecting a loss of focus on the main window
const handleBlur = () => {
if (document.activeElement?.tagName === "IFRAME") {
if (
document.activeElement &&
["IFRAME", "BODY"].includes(document.activeElement.tagName)
) {
handleClick(
new MouseEvent("click", { relatedTarget: document.activeElement })
)