Skip to content

Commit

Permalink
fix: add overflow to the generated table
Browse files Browse the repository at this point in the history
  • Loading branch information
LIlGG committed Jan 15, 2024
1 parent 97a4c08 commit 6a892d7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions console/packages/editor/src/extensions/table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,18 @@ const Table = TiptapTable.extend<ExtensionOptions & TableOptions>({
);

const table: DOMOutputSpec = [
"table",
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
style: tableWidth
? `width: ${tableWidth}`
: `minWidth: ${tableMinWidth}`,
}),
colgroup,
["tbody", 0],
"div",
{ style: "overflow-x: auto; overflow-y: hidden;" },
[
"table",
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
style: tableWidth
? `width: ${tableWidth}`
: `minWidth: ${tableMinWidth}`,
}),
colgroup,
["tbody", 0],
],
];

return table;
Expand Down

0 comments on commit 6a892d7

Please sign in to comment.