Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(editor): wrap tables in tableWrapper so wide tables scroll locally (#4003)

Naiyuan Qingf2ba3c8f1a65
diff --git a/packages/views/editor/extensions/index.ts b/packages/views/editor/extensions/index.ts
index 64531ecaa8..aac3f459c1 100644
--- a/packages/views/editor/extensions/index.ts
+++ b/packages/views/editor/extensions/index.ts
@@ -180,7 +180,12 @@ export function createEditorExtensions(
// markdownPaste's handlePaste is a catch-all that returns true.
LinkExtension,
ImageExtension,
- Table.configure({ resizable: false }),
+ // renderWrapper wraps the table in `<div class="tableWrapper">` (the same
+ // wrapper the resizable NodeView emits), which prose.css styles with
+ // `overflow-x: auto`. Without it a wide table is a bare <table> that can't
+ // shrink below min-content, so the horizontal scrollbar lands on the
+ // page-level scroll container instead of the table itself.
+ Table.configure({ resizable: false, renderWrapper: true }),
TableRow,
TableHeader,
TableCell,