11import { dropdownControl } from "comps/controls/dropdownControl" ;
22import { stringExposingStateControl } from "comps/controls/codeStateControl" ;
33import { AutoHeightControl } from "comps/controls/autoHeightControl" ;
4- import { Section , sectionNames } from "lowcoder-design" ;
4+ import { ScrollBar , Section , sectionNames } from "lowcoder-design" ;
55import styled , { css } from "styled-components" ;
66import { AlignCenter } from "lowcoder-design" ;
77import { AlignLeft } from "lowcoder-design" ;
@@ -24,6 +24,7 @@ import { clickEvent, eventHandlerControl } from "../controls/eventHandlerControl
2424import { NewChildren } from "../generators/uiCompBuilder" ;
2525import { RecordConstructorToComp } from "lowcoder-core" ;
2626import { ToViewReturn } from "../generators/multi" ;
27+ import { BoolControl } from "@lowcoder-ee/index.sdk" ;
2728
2829const EventOptions = [ clickEvent ] as const ;
2930
@@ -142,6 +143,7 @@ const childrenMap = {
142143 autoHeight : AutoHeightControl ,
143144 type : dropdownControl ( typeOptions , "markdown" ) ,
144145 horizontalAlignment : alignWithJustifyControl ( ) ,
146+ contentScrollBar : withDefault ( BoolControl , true ) ,
145147 verticalAlignment : dropdownControl ( VerticalAlignmentOptions , "center" ) ,
146148 style : styleControl ( TextStyle , 'style' ) ,
147149 animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
@@ -176,6 +178,10 @@ const TextPropertyView = React.memo((props: {
176178 < >
177179 < Section name = { sectionNames . layout } >
178180 { props . children . autoHeight . getPropertyView ( ) }
181+ { ! props . children . autoHeight . getView ( ) &&
182+ props . children . contentScrollBar . propertyView ( {
183+ label : trans ( "prop.contentScrollbar" ) ,
184+ } ) }
179185 { ! props . children . autoHeight . getView ( ) &&
180186 props . children . verticalAlignment . propertyView ( {
181187 label : trans ( "textShow.verticalAlignment" ) ,
@@ -214,7 +220,9 @@ const TextView = React.memo((props: ToViewReturn<ChildrenType>) => {
214220 } }
215221 onClick = { ( ) => props . onEvent ( "click" ) }
216222 >
217- { props . type === "markdown" ? < TacoMarkDown > { value } </ TacoMarkDown > : value }
223+ < ScrollBar hideScrollbar = { ! props . contentScrollBar } >
224+ { props . type === "markdown" ? < TacoMarkDown > { value } </ TacoMarkDown > : value }
225+ </ ScrollBar >
218226 </ TextContainer >
219227 ) ;
220228} , ( prev , next ) => JSON . stringify ( prev ) === JSON . stringify ( next ) ) ;
0 commit comments