Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle cases when elements are in an iframe #438

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

collins-lagat
Copy link

Fixes this issue #427. Related to this other issue on WordPress WordPress/gutenberg#53867

And edge case is when an element exists in an iframe thus the Window object in the iframe will be different from the main Window. Thus thus comparison fails:

: elements instanceof HTMLElement

Iframes tend to be used by page builders such as gutenberg, grapesjs (I haven't tested it here), etc. that rely on iframes for isolation. The fix here fixes this issue.
Any edits are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant