From e7b7aad413bf71cc2e2f28e30b1a1588191781bd Mon Sep 17 00:00:00 2001 From: sibiraj-s Date: Mon, 28 Dec 2020 13:09:55 +0530 Subject: [PATCH] fix: update active link helper --- src/helpers/isLinkActive.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/helpers/isLinkActive.ts b/src/helpers/isLinkActive.ts index e7a48543..e41e83dc 100644 --- a/src/helpers/isLinkActive.ts +++ b/src/helpers/isLinkActive.ts @@ -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) &&