|
7 | 7 | } from "comps/controls/styleControlConstants";
|
8 | 8 | import { EditorContext } from "comps/editorState";
|
9 | 9 | import { BackgroundColorContext } from "comps/utils/backgroundColorContext";
|
10 |
| -import { HintPlaceHolder, TacoMarkDown } from "lowcoder-design"; |
| 10 | +import { HintPlaceHolder, ScrollBar, TacoMarkDown } from "lowcoder-design"; |
11 | 11 | import { ReactNode, useContext } from "react";
|
12 | 12 | import styled, { css } from "styled-components";
|
13 | 13 | import { checkIsMobile } from "util/commonUtils";
|
@@ -76,6 +76,7 @@ ${props=>props.$animationStyle&&props.$animationStyle}
|
76 | 76 | display: flex;
|
77 | 77 | flex-flow: column;
|
78 | 78 | height: 100%;
|
| 79 | + overflow-y: scroll; |
79 | 80 | border: ${(props) => props.$style.borderWidth} ${(props) => (props.$style.borderStyle ? props.$style.borderStyle : "solid")} ${(props) => props.$style.border};
|
80 | 81 | border-radius: ${(props) => props.$style.radius};
|
81 | 82 | background-color: ${(props) => props.$style.background};
|
@@ -194,45 +195,42 @@ export function TriContainer(props: TriContainerProps) {
|
194 | 195 | )}
|
195 | 196 | {showBody && (
|
196 | 197 | <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> |
236 | 234 | </BackgroundColorContext.Provider>
|
237 | 235 | )}
|
238 | 236 | {showFooter && (
|
|
0 commit comments