Skip to content

Commit d1263e9

Browse files
committed
fix: constrain code editor width in vertical layout examples
Wrap CodeEditor in a flex container with min-w-0 and overflow-hidden to prevent content from expanding beyond available space. Set fixed width on preview container to ensure proper flex distribution.
1 parent 8373cde commit d1263e9

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/components/Examples/ExamplesRenderer.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,19 @@ const ExamplesRenderer = ({
166166
isLargeLayout && 'md:flex-col',
167167
)}
168168
>
169-
<CodeEditor
170-
theme="light"
171-
editor={{
172-
className: '',
173-
showLineNumbers: true,
174-
}}
175-
/>
169+
<div className={cn('min-w-0 overflow-hidden', isVerticalLayout && 'md:flex-1')}>
170+
<CodeEditor
171+
theme="light"
172+
editor={{
173+
className: '',
174+
showLineNumbers: true,
175+
}}
176+
/>
177+
</div>
176178
<div
177179
className={cn(
178180
'flex gap-4 flex-col sm:flex-row',
179-
isVerticalLayout && 'md:flex-col',
181+
isVerticalLayout && 'md:flex-col md:w-[21.875rem] md:flex-shrink-0',
180182
isLargeLayout && 'md:flex-row md:justify-center md:h-fit md:min-h-[700px] h-[400px]',
181183
)}
182184
>

0 commit comments

Comments
 (0)