Skip to content
Snippets Groups Projects
Commit b470f245 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

Clear contentEditable selection when it can't be drawn

So that we don't leave a stray selection that'll be reset
to some nonsense position by the DOM changes.

Closes #4625
parent 168d2286
No related branches found
No related tags found
No related merge requests found
......@@ -122,7 +122,10 @@ export default class ContentEditableInput {
let start = posToDOM(this.cm, prim.from())
let end = posToDOM(this.cm, prim.to())
if (!start && !end) return
if (!start && !end) {
sel.removeAllRanges()
return
}
let view = this.cm.display.view
let old = sel.rangeCount && sel.getRangeAt(0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment