Skip to content

Commit e85065b

Browse files
committed
Fixed create link button not showing editor selection
1 parent 9d17f78 commit e85065b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/react/src/components/FormattingToolbar/DefaultButtons/CreateLinkButton.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import {
88
isTableCellSelection,
99
StyleSchema,
1010
} from "@blocknote/core";
11-
import { FormattingToolbarExtension } from "@blocknote/core/extensions";
11+
import {
12+
FormattingToolbarExtension,
13+
ShowSelectionExtension,
14+
} from "@blocknote/core/extensions";
1215

1316
import { useComponentsContext } from "../../../editor/ComponentsContext.js";
1417
import { useBlockNoteEditor } from "../../../hooks/useBlockNoteEditor.js";
@@ -42,8 +45,12 @@ export const CreateLinkButton = () => {
4245
const dict = useDictionary();
4346

4447
const formattingToolbar = useExtension(FormattingToolbarExtension);
48+
const { showSelection } = useExtension(ShowSelectionExtension);
4549

4650
const [showPopover, setShowPopover] = useState(false);
51+
useEffect(() => {
52+
showSelection(showPopover);
53+
}, [showPopover, showSelection]);
4754

4855
const state = useEditorState({
4956
editor,

0 commit comments

Comments
 (0)