Skip to content

Commit

Permalink
Only update range once after removing highlight on all text nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
peitschie committed Oct 2, 2014
1 parent d6b0481 commit 0e8a71c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/modules/rangy-classapplier.js
Original file line number Diff line number Diff line change
Expand Up @@ -904,10 +904,9 @@ rangy.createModule("ClassApplier", ["WrappedSelection"], function(api, module) {
if (ancestorWithClass && this.isModifiable(textNode)) {
this.undoToAncestor(ancestorWithClass, positionsToPreserve);
}

// Ensure the range is still valid
range.setStartAndEnd(textNodes[0], 0, lastTextNode, lastTextNode.length);
}
// Ensure the range is still valid
range.setStartAndEnd(textNodes[0], 0, lastTextNode, lastTextNode.length);

log.info("Undo set range to '" + textNodes[0].data + "', '" + textNode.data + "'");

Expand Down

0 comments on commit 0e8a71c

Please sign in to comment.