fix isAtEnd

This commit is contained in:
Peter Savchenko 2018-05-29 17:34:05 +03:00
commit 768348fb85
No known key found for this signature in database
GPG key ID: 63E739583C761566
3 changed files with 3 additions and 3 deletions

View file

@ -2689,7 +2689,7 @@ var Caret = function (_Module) {
return node.textContent.length === 0;
});
if (nothingAtRight && selection.anchorOffset === 0) {
if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) {
return true;
}

File diff suppressed because one or more lines are too long

View file

@ -242,7 +242,7 @@ export default class Caret extends Module {
let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'),
nothingAtRight = leftSiblings.every( node => node.textContent.length === 0 );
if (nothingAtRight && selection.anchorOffset === 0) {
if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) {
return true;