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

Greyepoxy/issue 2633 #2953

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

greyepoxy
Copy link

This fixes #2633

Core issue was that selection code was trying to get selection from the top level document and not the container elements document.

With this change I updated the unit tests to run in an iframe which should prevent this issue from re-occurring.

@greyepoxy
Copy link
Author

I investigated why its not working in several browsers. Looks like its because some browsers re-define HTMLElement (and other dom functions) on the Window object. So checks like someDomNode instanceof HTMLElement always returns false when someDomNode is in an iframe.

I fixed the two cases of this I found in quill and it resolved a bunch of tests but there is one in parchment that is causing a huge number of failures https://github.com/quilljs/parchment/blob/master/src/registry.ts#L83. Will update it to check against the type defined on the current elements window object.

I will open a merge request over there as well to

@greyepoxy
Copy link
Author

I believe this change in combination with quilljs/parchment#82 should resolve all of the cross browser issues (although I just tested on edge/chrome/firefox since I am on windows)

@luin luin self-requested a review April 18, 2024 01:31
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.

Set Editor into Iframe - Format and other functions not working
1 participant