open debugger with pause on exceptions
go to basic demo
delete everything
insert horizontal rule
click above or on the rule
I get exception:
prosemirror.js:5678 Uncaught RangeError: Searching for selection in invalid document doc(horizontal_rule)
at Function.near (prosemirror.js:5678)
at Function.between (prosemirror.js:5796)
at selectionBetween (prosemirror.js:10852)
at SelectionReader.readFromDOM (prosemirror.js:10670)
at HTMLDocument.SelectionChangePoller.readFunc (prosemirror.js:10693)
I do ctrl+a and del
then insert -> horizontal rule
then click anywhere below the menubar and above the horizontal rule created or on the middle of the horizontal rule or sometime even below the line.
Ah, I can reproduce this now. The issue is that TextSelection.betweencan’t produce a text selection in some documents. I’ve adjusted it to fall back to a node selection in this case in 7acf76f817f.