mirror of
https://github.com/codex-team/editor.js
synced 2026-03-18 08:29:52 +01:00
fix isAtEnd
This commit is contained in:
parent
e85725f12e
commit
768348fb85
3 changed files with 3 additions and 3 deletions
|
|
@ -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
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue