@@ -18,17 +18,20 @@ import {
1818import { ContextContainerComp } from "./contextContainerComp" ;
1919import { ListViewImplComp } from "./listViewComp" ;
2020import { getCurrentItemParams , getData } from "./listViewUtils" ;
21+ import { useMergeCompStyles } from "@lowcoder-ee/util/hooks" ;
2122import { childrenToProps } from "@lowcoder-ee/comps/generators/multi" ;
2223import { AnimationStyleType } from "@lowcoder-ee/comps/controls/styleControlConstants" ;
2324
24- const ListViewWrapper = styled . div < { $style : any ; $paddingWidth : string , $animationStyle :AnimationStyleType } > `
25+ const ListViewWrapper = styled . div < { $style : any ; $paddingWidth : string , $animationStyle :AnimationStyleType , $autoHeight : boolean } > `
2526 height: 100%;
27+ overflow: ${ ( props ) => ( ! props . $autoHeight ? "scroll" : "hidden" ) } ;
2628 border: 1px solid ${ ( props ) => props . $style . border } ;
2729 border-radius: ${ ( props ) => props . $style . radius } ;
2830 padding: 3px ${ ( props ) => props . $paddingWidth } ;
2931 rotate: ${ ( props ) => props . $style . rotation } ;
3032 background-color: ${ ( props ) => props . $style . background } ;
3133 ${ props => props . $animationStyle }
34+
3235` ;
3336
3437const FooterWrapper = styled . div `
@@ -190,7 +193,7 @@ export function ListView(props: Props) {
190193 const horizontalGridCells = useMemo ( ( ) => children . horizontalGridCells . getView ( ) , [ children . horizontalGridCells ] ) ;
191194 const autoHeight = useMemo ( ( ) => children . autoHeight . getView ( ) , [ children . autoHeight ] ) ;
192195 const showHorizontalScrollbar = useMemo ( ( ) => children . showHorizontalScrollbar . getView ( ) , [ children . showHorizontalScrollbar ] ) ;
193- const showVerticalScrollbar = useMemo ( ( ) => children . showVerticalScrollbar . getView ( ) , [ children . showVerticalScrollbar ] ) ;
196+ const showVerticalScrollbar = useMemo ( ( ) => children . showVerticalScrollbar . getView ( ) , [ children . showVerticalScrollbar ] )
194197 const horizontal = useMemo ( ( ) => children . horizontal . getView ( ) , [ children . horizontal ] ) ;
195198 const minHorizontalWidth = useMemo ( ( ) => children . minHorizontalWidth . getView ( ) , [ children . minHorizontalWidth ] ) ;
196199 const noOfColumns = useMemo (
@@ -284,12 +287,14 @@ export function ListView(props: Props) {
284287
285288 const childrenProps = childrenToProps ( comp . children ) ;
286289
290+ useMergeCompStyles ( childrenProps , comp . dispatch ) ;
291+
287292 // log.debug("renders: ", renders);
288293 return (
289294 < BackgroundColorContext . Provider value = { style . background } >
290- < ListViewWrapper $style = { style } $paddingWidth = { paddingWidth } $animationStyle = { animationStyle } >
295+ < ListViewWrapper $style = { style } $paddingWidth = { paddingWidth } $animationStyle = { animationStyle } $autoHeight = { autoHeight } >
291296 < BodyWrapper ref = { ref } $autoHeight = { autoHeight } >
292- < ScrollBar style = { { height : autoHeight ? "auto" : "100%" , margin : "0px" , padding : "0px" } } hideScrollbar = { horizontal ? ! showHorizontalScrollbar : ! showVerticalScrollbar } overflow = { autoHeight ? horizontal ? 'scroll' : 'hidden' : 'scroll' } >
297+ < ScrollBar style = { { height : autoHeight ? "auto" : "100%" , margin : "0px" , padding : "0px" } } hideScrollbar = { horizontal ? ! showHorizontalScrollbar : ! showVerticalScrollbar } overflow = { autoHeight ? horizontal ? 'scroll' : 'hidden' : 'scroll' } >
293298 < ReactResizeDetector
294299 onResize = { ( width ?: number , height ?: number ) => {
295300 if ( height ) setListHeight ( height ) ;
@@ -315,3 +320,4 @@ export function ListView(props: Props) {
315320 </ BackgroundColorContext . Provider >
316321 ) ;
317322}
323+
0 commit comments