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

[shadow dom] make codemirror work inside closed shadow root #7075

Merged
merged 1 commit into from Nov 11, 2023

Conversation

pavelfeldman
Copy link
Contributor

Ref #7074

This change should be:

  • noop for old <2017 browsers
  • noop for modern browsers when codemirror is in the document or in the open shadow root
  • should be fixing input (focus, pasting) when codemirror is in the closed shadow root

The problem was that we were going from element to ownerDocument and then descending. And closer roots can only be pierced one way. The solution is to not climb to the ownerDocument, but stop at the local root node (nearest shadow root).

Works on Safari.

@marijnh marijnh merged commit 676fc52 into codemirror:master Nov 11, 2023
1 check passed
@marijnh
Copy link
Member

marijnh commented Nov 11, 2023

Thanks, this looks solid.

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.

None yet

2 participants