Skip to content

Commit

Permalink
Fix scrollable table exportDOM
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Nov 29, 2024
1 parent 16e4987 commit 60801f9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/lexical-table/src/LexicalTableNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,12 @@ export class TableNode extends ElementNode {
}

exportDOM(editor: LexicalEditor): DOMExportOutput {
const {element, after} = super.exportDOM(editor);
return {
...super.exportDOM(editor),
after: (tableElement) => {
if (after) {
tableElement = after(tableElement);
}
if (
tableElement &&
isHTMLElement(tableElement) &&
Expand All @@ -249,6 +252,10 @@ export class TableNode extends ElementNode {
}
return tableElement;
},
element:
element && isHTMLElement(element) && element.nodeName !== 'TABLE'
? element.querySelector('table')
: element,
};
}

Expand Down

0 comments on commit 60801f9

Please sign in to comment.