0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00

Fix cursor location after Range::_deleteContents

Should always collapse to start.
This commit is contained in:
Neil Jenkins 2012-04-04 15:11:27 +10:00
parent 5c9420c7fa
commit c595fb0bb8

View file

@ -209,9 +209,8 @@ implement( Range.prototype, {
var isCollapsed = this.collapsed; var isCollapsed = this.collapsed;
this.moveBoundariesDownTree(); this.moveBoundariesDownTree();
if ( isCollapsed ) { if ( isCollapsed ) {
// Hopefully at least start or end is now a text node. // Collapse
// Make that the focus point. this.collapse( true );
this.collapse( this.startContainer.nodeType === TEXT_NODE );
} }
return this; return this;