mirror of
https://github.com/docmost/docmost.git
synced 2025-11-12 23:52:36 +10:00
fix toggle node in non-edit mode
This commit is contained in:
@ -111,6 +111,7 @@ export const Details = Node.create<DetailsOptions>({
|
||||
if (updatedNode.type !== this.type) {
|
||||
return false;
|
||||
}
|
||||
if (!editor.isEditable) return true;
|
||||
if (updatedNode.attrs.open) {
|
||||
dom.setAttribute("open", "true");
|
||||
} else {
|
||||
@ -132,9 +133,10 @@ export const Details = Node.create<DetailsOptions>({
|
||||
}
|
||||
|
||||
const slice = state.doc.slice(range.start, range.end);
|
||||
|
||||
if(slice.content.firstChild.type.name === "detailsSummary") return false;
|
||||
|
||||
|
||||
if (slice.content.firstChild.type.name === "detailsSummary")
|
||||
return false;
|
||||
|
||||
if (
|
||||
!state.schema.nodes.detailsContent.contentMatch.matchFragment(
|
||||
slice.content,
|
||||
|
||||
Reference in New Issue
Block a user