diff --git a/packages/super-editor/src/components/toolbar/Toolbar.vue b/packages/super-editor/src/components/toolbar/Toolbar.vue index c09917a281..798c2c4584 100644 --- a/packages/super-editor/src/components/toolbar/Toolbar.vue +++ b/packages/super-editor/src/components/toolbar/Toolbar.vue @@ -13,7 +13,7 @@ import { undoDepth, redoDepth } from 'prosemirror-history'; const props = defineProps({ editorInstance: { type: Object, - required: true, + required: false, }, updateTransaction: { type: Object, @@ -332,7 +332,8 @@ const alignment = makeToolbarItem({ markName: 'textAlign', labelAttr: 'textAlign', getIcon(self) { - const attrs = self.editor.getAttributes('paragraph').textAlign; + let attrs = self.editor?.getAttributes('paragraph').textAlign; + if (!attrs) attrs = 'left'; return `fa-align-${attrs}`; }, onTextMarkSelection(self, mark) { @@ -570,8 +571,8 @@ const toolbarItems = ref([ alignment, bulletedList, numberedList, - indentRight, indentLeft, + indentRight, separator, search, overflow, @@ -762,23 +763,6 @@ defineExpose({