Call caretRange/PositionFromPoint on the document, not the root
Call caretRange/PositionFromPoint on the document, not the root

Seem browsers have dropped these methods on shadow roots.

ProseMirror/prosemirror-view