Skip to content

Commit add5374

Browse files
sleitorDmitrii Troitskiihaydenbleaselclaude
authored
fix(code-block): enable horizontal scrolling for long lines in code blocks (#439)
* fix(code-block): enable horizontal scrolling for long lines in code blocks Change overflow-hidden to overflow-x-auto on the code block body container so that long single-line comments and other long code lines are scrollable horizontally instead of being silently clipped. Fixes #438 * Add changeset for code block horizontal scroll fix Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Dmitrii Troitskii <jsleitor@gmail.com> Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 90f6bb6 commit add5374

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"streamdown": patch
3+
---
4+
5+
Enable horizontal scrolling on code blocks so long lines are accessible instead of being clipped by `overflow-hidden`.

packages/streamdown/lib/code-block/body.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const CodeBlockBody = memo(
8282
<div
8383
className={cn(
8484
className,
85-
"overflow-hidden rounded-md border border-border bg-background p-4 text-sm"
85+
"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"
8686
)}
8787
data-language={language}
8888
data-streamdown="code-block-body"

0 commit comments

Comments
 (0)