Skip to content

Commit 3fd80fb

Browse files
committed
[@mantine/core] ScrollArea: Fix content overflowing the viewport in some cases (#7748)
1 parent d01240d commit 3fd80fb

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

packages/@mantine/core/src/components/ScrollArea/ScrollArea.story.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useState } from 'react';
22
import { Box } from '../../core';
33
import { Code } from '../Code';
4+
import { MultiSelect } from '../MultiSelect';
45
import { Paper } from '../Paper';
56
import { Stack } from '../Stack';
67
import { ScrollArea } from './ScrollArea';
@@ -104,3 +105,24 @@ export function NeverType() {
104105
</ScrollArea>
105106
);
106107
}
108+
109+
export function OverflowIssue() {
110+
return (
111+
<div style={{ padding: 40 }}>
112+
<Box w={200}>
113+
<MultiSelect
114+
data={['This is a very long name to demonstrate the bug', 'Option2']}
115+
defaultValue={['This is a very long name to demonstrate the bug']}
116+
mb={10}
117+
/>
118+
119+
<ScrollArea w={200} scrollbars="y">
120+
<MultiSelect
121+
data={['This is a very long name to demonstrate the bug', 'Option2']}
122+
defaultValue={['This is a very long name to demonstrate the bug']}
123+
/>
124+
</ScrollArea>
125+
</Box>
126+
</div>
127+
);
128+
}

packages/@mantine/core/src/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const ScrollAreaViewport = forwardRef<HTMLDivElement, ScrollAreaViewportP
2020
...style,
2121
}}
2222
>
23-
<div style={{ minWidth: '100%', display: 'table' }} ref={ctx.onContentChange}>
23+
<div style={{ minWidth: '100%' }} ref={ctx.onContentChange}>
2424
{children}
2525
</div>
2626
</Box>

0 commit comments

Comments
 (0)