codemirror / codemirror5

In-browser code editor (version 5, legacy)
http://codemirror.net/5/
MIT License
26.84k stars 4.97k forks source link

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

Closed pavelfeldman closed 1 year ago

pavelfeldman commented 1 year ago

Ref https://github.com/codemirror/codemirror5/issues/7074

This change should be:

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 commented 1 year ago

Thanks, this looks solid.