From c595fb0bb8049d93d1685724969d2b0debce9c16 Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Wed, 4 Apr 2012 15:11:27 +1000 Subject: [PATCH] Fix cursor location after Range::_deleteContents Should always collapse to start. --- source/Range.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/Range.js b/source/Range.js index fa29c4e..801b3d6 100644 --- a/source/Range.js +++ b/source/Range.js @@ -209,9 +209,8 @@ implement( Range.prototype, { var isCollapsed = this.collapsed; this.moveBoundariesDownTree(); if ( isCollapsed ) { - // Hopefully at least start or end is now a text node. - // Make that the focus point. - this.collapse( this.startContainer.nodeType === TEXT_NODE ); + // Collapse + this.collapse( true ); } return this;