Fixes Tiptap Toolbar loading value

This commit is contained in:
leekelleher
2024-11-12 09:27:05 +00:00
committed by Jacob Overgaard
parent 9cb4a4213d
commit 46fa7a3393

View File

@@ -36,7 +36,7 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement
set value(value: UmbTiptapToolbarValue | undefined) {
if (!value) value = [[[]]];
if (value === this.#value) return;
this.#context.setToolbar(value);
this.#value = value;
}
get value(): UmbTiptapToolbarValue | undefined {
return this.#value?.map((rows) => rows.map((groups) => [...groups]));
@@ -66,6 +66,10 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement
});
}
protected override firstUpdated() {
this.#context.setToolbar(this.value);
}
#onClick(item: UmbTiptapToolbarExtension) {
const lastRow = (this.#value?.length ?? 1) - 1;
const lastGroup = (this.#value?.[lastRow].length ?? 1) - 1;