diff --git a/app/editor/components/SelectionToolbar.tsx b/app/editor/components/SelectionToolbar.tsx index 4deda9330..5129cb6a4 100644 --- a/app/editor/components/SelectionToolbar.tsx +++ b/app/editor/components/SelectionToolbar.tsx @@ -1,3 +1,4 @@ +import { some } from "lodash"; import { EditorState, NodeSelection, TextSelection } from "prosemirror-state"; import * as React from "react"; import createAndInsertLink from "@shared/editor/commands/createAndInsertLink"; @@ -78,7 +79,10 @@ function useIsActive(state: EditorState) { } const slice = selection.content(); - return !!slice.content.textBetween(0, slice.content.size); + const fragment = slice.content; + const nodes = (fragment as any).content; + + return some(nodes, (n) => n.content.size); } function useIsDragging() {