From af3cda1c53b8c6998de30fc310cdb8bdb3d6b4cd Mon Sep 17 00:00:00 2001 From: Zeno Kapitein Date: Wed, 17 Jun 2026 13:32:53 +0200 Subject: [PATCH] Fix wide content overflowing hint blocks (#4320) Co-authored-by: Claude Opus 4.8 --- .changeset/hint-wide-content-overflow.md | 5 +++++ packages/gitbook/src/components/DocumentView/Hint.tsx | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/hint-wide-content-overflow.md diff --git a/.changeset/hint-wide-content-overflow.md b/.changeset/hint-wide-content-overflow.md new file mode 100644 index 000000000..73f1956a7 --- /dev/null +++ b/.changeset/hint-wide-content-overflow.md @@ -0,0 +1,5 @@ +--- +"gitbook": patch +--- + +Fix wide content (such as code blocks and tables) overflowing the edges of hint blocks instead of scrolling within them. diff --git a/packages/gitbook/src/components/DocumentView/Hint.tsx b/packages/gitbook/src/components/DocumentView/Hint.tsx index 28d67b5c2..38f9052b5 100644 --- a/packages/gitbook/src/components/DocumentView/Hint.tsx +++ b/packages/gitbook/src/components/DocumentView/Hint.tsx @@ -92,6 +92,11 @@ export async function Hint({ 'empty:p-0', '-row-end-1', '-col-end-1', + // Allow the grid track to shrink below its content's min-content size so wide + // nested blocks (e.g. code blocks, tables) scroll internally instead of + // overflowing the hint. Without this, the `1fr` column keeps its default + // `min-width: auto` and grows past the hint's width. + 'min-w-0', 'space-y-3', '[&_.hint]:border', '[&_pre]:border',