Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: make link uneditable in readonly mode (#1968)

Muhammad Alie06cbb39b08c
diff --git a/packages/editor/src/toolbar/tools/link.tsx b/packages/editor/src/toolbar/tools/link.tsx
index d72c8f6c4..599a32ebb 100644
--- a/packages/editor/src/toolbar/tools/link.tsx
+++ b/packages/editor/src/toolbar/tools/link.tsx
@@ -154,7 +154,7 @@ export function EditLink(props: ToolProps) {
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
-
+ if (!editor.current?.isEditable) return null;
return (
<LinkTool
{...props}
@@ -180,6 +180,7 @@ export function EditLink(props: ToolProps) {
export function RemoveLink(props: ToolProps) {
const { editor, selectedNode } = props;
+ if (!editor.current?.isEditable) return null;
return (
<ToolButton
{...props}