Skip to content

Commit

Permalink
[lexical-table] Bug Fix: Fix scrollable table exportDOM (#6884)
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum authored Nov 29, 2024
1 parent 16e4987 commit 9a51939
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 9a51939

Please sign in to comment.