fix: disable node views in readonly mode

This commit is contained in:
thecodrr
2022-06-29 11:41:43 +05:00
parent 4fba7ed9fc
commit 73507e1771
17 changed files with 155 additions and 100 deletions

View File

@@ -76,7 +76,9 @@ export class SelectionBasedNodeView<
): React.ReactElement<any> | null {
if (!this.options.component) return null;
const theme = this.editor.storage.theme as Theme;
const isSelected = this.insideSelection() || this.nodeInsideSelection();
const isSelected =
this.editor.isEditable &&
(this.insideSelection() || this.nodeInsideSelection());
return (
<ThemeProvider theme={theme}>