fix: Code toolbar in read-only

This commit is contained in:
Tom Moor
2023-07-18 19:39:23 -04:00
parent 1e78079ade
commit eae6204d55
2 changed files with 5 additions and 1 deletions

View File

@@ -7,8 +7,12 @@ import { Dictionary } from "~/hooks/useDictionary";
export default function codeMenuItems(
state: EditorState,
readOnly: boolean | undefined,
dictionary: Dictionary
): MenuItem[] {
if (readOnly) {
return [];
}
const node = state.selection.$from.node();
return [