From 30dc11fd3c23b4790662f770d6c00324e47b743b Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Fri, 9 Dec 2016 10:41:52 +1100 Subject: [PATCH] If deleting range to start/end of doc, collapse into a block --- source/Range.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Range.js b/source/Range.js index bcc4f2a..bf02668 100644 --- a/source/Range.js +++ b/source/Range.js @@ -172,7 +172,7 @@ var deleteContentsOfRange = function ( range, root ) { fixCursor( root, root ); range.selectNodeContents( root.firstChild ); } else { - range.collapse( false ); + range.collapse( range.endContainer === root ? true : false ); } return frag; };