Skip to content

Commit

Permalink
fix: update active link helper
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Dec 28, 2020
1 parent 5f35cff commit e7b7aad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helpers/isLinkActive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export const isLinkActive = (state: EditorState): boolean => {
const isForwardSelection = anchor === from;
const linkMarks: Mark[] = getSelectionMarks(state).filter(mark => mark.type === schema.marks.link);

if (!linkMarks.length) {
return false;
}

const selectionHasOnlyMarks = isForwardSelection ?
(
state.doc.rangeHasMark(anchor, anchor + 1, schema.marks.link) &&
Expand Down

0 comments on commit e7b7aad

Please sign in to comment.