fix: Full-width image control should act as toggle

closes #8954
This commit is contained in:
Tom Moor committed 2025-04-15 08:18:20 -04:00
1 parent 6393bd02f4
commit 53fd19ae2e
1 file changed
+5 -1
+5 -1
View File
@@ -408,10 +408,14 @@ export default class Image extends SimpleImage {
if (!(state.selection instanceof NodeSelection)) {
return false;
}
let layoutClass: string | null = "full-width";
if (state.selection.node.attrs.layoutClass === layoutClass) {
layoutClass = null;
}
const attrs = {
...state.selection.node.attrs,
title: null,
layoutClass: "full-width",
layoutClass,
};
const { selection } = state;
dispatch?.(state.tr.setNodeMarkup(selection.from, undefined, attrs));