Skip to content

Commit e3904af

Browse files
committed
move scrollbar to parent container border
1 parent d4ae875 commit e3904af

3 files changed

Lines changed: 24 additions & 20 deletions

File tree

src/components/Chat/ChatArea.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,14 @@ export const ChatArea = ({
5454
>
5555
{chatField && (
5656
<FlexibleLayoutItem
57-
className={`${eccgui}-chat__area-contents`}
5857
growFactor={0}
5958
shrinkFactor={0}
6059
style={chatFieldPosition === "bottom" ? { order: 1 } : undefined}
6160
>
62-
{chatField}
61+
<div className={`${eccgui}-chat__area-contentwidth`}>{chatField}</div>
6362
</FlexibleLayoutItem>
6463
)}
6564
<FlexibleLayoutItem
66-
className={`${eccgui}-chat__area-contents`}
6765
style={
6866
otherFlexibleLayoutContainerProps.useAbsoluteSpace
6967
? {
@@ -74,18 +72,20 @@ export const ChatArea = ({
7472
: undefined
7573
}
7674
>
77-
{autoSpacingSize && children ? (
78-
<ul>
79-
{React.Children.toArray(children).map((child) => (
80-
<li>
81-
{child}
82-
<Spacing size={autoSpacingSize} />
83-
</li>
84-
))}
85-
</ul>
86-
) : (
87-
children
88-
)}
75+
<div className={`${eccgui}-chat__area-contentwidth`}>
76+
{autoSpacingSize && children ? (
77+
<ul>
78+
{React.Children.toArray(children).map((child) => (
79+
<li>
80+
{child}
81+
<Spacing size={autoSpacingSize} />
82+
</li>
83+
))}
84+
</ul>
85+
) : (
86+
children
87+
)}
88+
</div>
8989
</FlexibleLayoutItem>
9090
</FlexibleLayoutContainer>
9191
);

src/components/Chat/_chat.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@
6565
resize: none !important;
6666
}
6767

68-
.#{$eccgui}-chat__area-contents {
68+
.#{$eccgui}-chat__area-contentwidth {
6969
width: 100%;
7070
margin: 0 auto;
7171

72-
.#{$eccgui}-chat__area--small > & {
72+
.#{$eccgui}-chat__area--small & {
7373
max-width: 40rem;
7474
}
75-
.#{$eccgui}-chat__area--medium > & {
75+
.#{$eccgui}-chat__area--medium & {
7676
max-width: 60rem;
7777
}
78-
.#{$eccgui}-chat__area--large > & {
78+
.#{$eccgui}-chat__area--large & {
7979
max-width: 80rem;
8080
}
8181
}

src/components/Chat/stories/ChatContent.stories.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ const TemplateFull: StoryFn<typeof ChatContent> = (args) => <ChatContent {...arg
3333

3434
export const Default = TemplateFull.bind({});
3535
Default.args = {
36-
children: <LoremIpsum p={2} avgSentencesPerParagraph={4} random={false} />,
36+
children: (
37+
<HtmlContentBlock>
38+
<LoremIpsum p={1} avgSentencesPerParagraph={5} random={false} />
39+
</HtmlContentBlock>
40+
),
3741
avatar: <Depiction image={<Icon name={"application-useraccount"} />} />,
3842
statusLine: (
3943
<OverflowText>

0 commit comments

Comments
 (0)