Skip to content

Commit d529033

Browse files
committed
FloatTextContainer: Added Main Content Scrollbar
1 parent 7f75647 commit d529033

File tree

1 file changed

+38
-40
lines changed

1 file changed

+38
-40
lines changed

client/packages/lowcoder/src/comps/comps/triContainerComp/triFloatTextContainer.tsx

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from "comps/controls/styleControlConstants";
88
import { EditorContext } from "comps/editorState";
99
import { BackgroundColorContext } from "comps/utils/backgroundColorContext";
10-
import { HintPlaceHolder, TacoMarkDown } from "lowcoder-design";
10+
import { HintPlaceHolder, ScrollBar, TacoMarkDown } from "lowcoder-design";
1111
import { ReactNode, useContext } from "react";
1212
import styled, { css } from "styled-components";
1313
import { checkIsMobile } from "util/commonUtils";
@@ -76,6 +76,7 @@ ${props=>props.$animationStyle&&props.$animationStyle}
7676
display: flex;
7777
flex-flow: column;
7878
height: 100%;
79+
overflow-y: scroll;
7980
border: ${(props) => props.$style.borderWidth} ${(props) => (props.$style.borderStyle ? props.$style.borderStyle : "solid")} ${(props) => props.$style.border};
8081
border-radius: ${(props) => props.$style.radius};
8182
background-color: ${(props) => props.$style.background};
@@ -194,45 +195,42 @@ export function TriContainer(props: TriContainerProps) {
194195
)}
195196
{showBody && (
196197
<BackgroundColorContext.Provider value={container.style.background}>
197-
<div
198-
style={{
199-
overflowY: "scroll",
200-
background: `${container.style.background}`,
201-
}}
202-
>
203-
<BodyInnerGrid
204-
$showBorder={false}
205-
{...otherBodyProps}
206-
horizontalGridCells={horizontalGridCells}
207-
items={gridItemCompToGridItems(bodyItems)}
208-
autoHeight={container.autoHeight}
209-
emptyRows={14}
210-
minHeight={showHeader ? "143px" : "142px"}
211-
containerPadding={[0, 0]}
212-
hintPlaceholder={props.hintPlaceholder ?? HintPlaceHolder}
213-
$backgroundColor={bodyStyle?.background || 'transparent'}
214-
$borderColor={style?.border}
215-
$borderWidth={style?.borderWidth}
216-
style={{
217-
float: `${props.float}`,
218-
width: `${props.float === "none" ? "100%" : `${props.width}%`}`,
219-
height: "100%",
220-
...container.bodyStyle
221-
}}
222-
/>
223-
<FloatTextWrapper
224-
$style={props.style}
225-
$horizontalAlignment={props.horizontalAlignment}
226-
>
227-
<p>
228-
{props.type === "markdown" ? (
229-
<TacoMarkDown>{text.value}</TacoMarkDown>
230-
) : (
231-
text.value
232-
)}
233-
</p>
234-
</FloatTextWrapper>
235-
</div>
198+
<ScrollBar style={{ height: container.autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={!container.showVerticalScrollbar}>
199+
<div style={{ background: `${container.style.background}` }}>
200+
<BodyInnerGrid
201+
$showBorder={false}
202+
{...otherBodyProps}
203+
horizontalGridCells={horizontalGridCells}
204+
items={gridItemCompToGridItems(bodyItems)}
205+
autoHeight={container.autoHeight}
206+
emptyRows={14}
207+
minHeight={showHeader ? "143px" : "142px"}
208+
containerPadding={[0, 0]}
209+
hintPlaceholder={props.hintPlaceholder ?? HintPlaceHolder}
210+
$backgroundColor={bodyStyle?.background || 'transparent'}
211+
$borderColor={style?.border}
212+
$borderWidth={style?.borderWidth}
213+
style={{
214+
float: `${props.float}`,
215+
width: `${props.float === "none" ? "100%" : `${props.width}%`}`,
216+
height: "100%",
217+
...container.bodyStyle
218+
}}
219+
/>
220+
<FloatTextWrapper
221+
$style={props.style}
222+
$horizontalAlignment={props.horizontalAlignment}
223+
>
224+
<p>
225+
{props.type === "markdown" ? (
226+
<TacoMarkDown>{text.value}</TacoMarkDown>
227+
) : (
228+
text.value
229+
)}
230+
</p>
231+
</FloatTextWrapper>
232+
</div>
233+
</ScrollBar>
236234
</BackgroundColorContext.Provider>
237235
)}
238236
{showFooter && (

0 commit comments

Comments
 (0)