How to insert content with JavaScript behavior and avoid infinite loop of mutation observer ? #5930
-
I am trying to create a button that will insert a table inside a tiptap editor. import Table from "@tiptap/extension-table";
const TableExtension = Table.extend({
parseHTML() {
return [{ tag: ".fr-table" }];
},
renderHTML({ node, HTMLAttributes }) {
const table = this.parent?.({ node, HTMLAttributes });
return ["div", { class: "fr-table" }, table];
},
});
export default TableExtension; The problem is that when I click the buttons that runs the command
How can I insert my custom table without ending in this infinite loop ? Thanks a lot |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You should not touch the elements generated by tiptap. So, unfortunately you may have to drop your design system (or at least tell it to not modify the html). |
Beta Was this translation helpful? Give feedback.
You should not touch the elements generated by tiptap. So, unfortunately you may have to drop your design system (or at least tell it to not modify the html).