1
1
import { dropdownControl } from "comps/controls/dropdownControl" ;
2
2
import { stringExposingStateControl } from "comps/controls/codeStateControl" ;
3
3
import { AutoHeightControl } from "comps/controls/autoHeightControl" ;
4
- import { Section , sectionNames } from "lowcoder-design" ;
4
+ import { ScrollBar , Section , sectionNames } from "lowcoder-design" ;
5
5
import styled , { css } from "styled-components" ;
6
6
import { AlignCenter } from "lowcoder-design" ;
7
7
import { AlignLeft } from "lowcoder-design" ;
@@ -24,6 +24,7 @@ import { clickEvent, eventHandlerControl } from "../controls/eventHandlerControl
24
24
import { NewChildren } from "../generators/uiCompBuilder" ;
25
25
import { RecordConstructorToComp } from "lowcoder-core" ;
26
26
import { ToViewReturn } from "../generators/multi" ;
27
+ import { BoolControl } from "@lowcoder-ee/index.sdk" ;
27
28
28
29
const EventOptions = [ clickEvent ] as const ;
29
30
@@ -142,6 +143,7 @@ const childrenMap = {
142
143
autoHeight : AutoHeightControl ,
143
144
type : dropdownControl ( typeOptions , "markdown" ) ,
144
145
horizontalAlignment : alignWithJustifyControl ( ) ,
146
+ contentScrollBar : withDefault ( BoolControl , true ) ,
145
147
verticalAlignment : dropdownControl ( VerticalAlignmentOptions , "center" ) ,
146
148
style : styleControl ( TextStyle , 'style' ) ,
147
149
animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
@@ -176,6 +178,10 @@ const TextPropertyView = React.memo((props: {
176
178
< >
177
179
< Section name = { sectionNames . layout } >
178
180
{ props . children . autoHeight . getPropertyView ( ) }
181
+ { ! props . children . autoHeight . getView ( ) &&
182
+ props . children . contentScrollBar . propertyView ( {
183
+ label : trans ( "prop.contentScrollbar" ) ,
184
+ } ) }
179
185
{ ! props . children . autoHeight . getView ( ) &&
180
186
props . children . verticalAlignment . propertyView ( {
181
187
label : trans ( "textShow.verticalAlignment" ) ,
@@ -214,7 +220,9 @@ const TextView = React.memo((props: ToViewReturn<ChildrenType>) => {
214
220
} }
215
221
onClick = { ( ) => props . onEvent ( "click" ) }
216
222
>
217
- { props . type === "markdown" ? < TacoMarkDown > { value } </ TacoMarkDown > : value }
223
+ < ScrollBar hideScrollbar = { ! props . contentScrollBar } >
224
+ { props . type === "markdown" ? < TacoMarkDown > { value } </ TacoMarkDown > : value }
225
+ </ ScrollBar >
218
226
</ TextContainer >
219
227
) ;
220
228
} , ( prev , next ) => JSON . stringify ( prev ) === JSON . stringify ( next ) ) ;
0 commit comments