Skip to content

Commit

Permalink
fix: prevent errors while selecting text color mark
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Dec 24, 2020
1 parent 34d9c55 commit b1e85bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/commands/TextColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class TextColor {
return false;
}

const { from, empty } = selection;
const { anchor, empty } = selection;
if (!empty) {
const node = doc.nodeAt(from);
const node = doc.nodeAt(anchor);
if (node.isAtom && !node.isText && node.isLeaf) {
// An atomic node (e.g. Image) is selected.
return false;
Expand Down

0 comments on commit b1e85bb

Please sign in to comment.