@@ -18,6 +18,7 @@ import {
18
18
import { ContextContainerComp } from "./contextContainerComp" ;
19
19
import { ListViewImplComp } from "./listViewComp" ;
20
20
import { getCurrentItemParams , getData } from "./listViewUtils" ;
21
+ import { useMergeCompStyles } from "@lowcoder-ee/util/hooks" ;
21
22
import { childrenToProps } from "@lowcoder-ee/comps/generators/multi" ;
22
23
import { AnimationStyleType } from "@lowcoder-ee/comps/controls/styleControlConstants" ;
23
24
@@ -29,6 +30,7 @@ const ListViewWrapper = styled.div<{ $style: any; $paddingWidth: string,$animati
29
30
rotate: ${ ( props ) => props . $style . rotation } ;
30
31
background-color: ${ ( props ) => props . $style . background } ;
31
32
${ props => props . $animationStyle }
33
+
32
34
` ;
33
35
34
36
const FooterWrapper = styled . div `
@@ -39,7 +41,8 @@ const FooterWrapper = styled.div`
39
41
` ;
40
42
41
43
const BodyWrapper = styled . div < { $autoHeight : boolean } > `
42
- height: ${ ( props ) => ( props . $autoHeight ? "100%" : "calc(100% - 32px)" ) } ;
44
+ overflow: ${ ( props ) => ( ! props . $autoHeight ? "auto" : "hidden" ) } ;
45
+ height: ${ ( props ) => ( props . $autoHeight ? "auto" : "calc(100% - 32px)" ) } ;
43
46
` ;
44
47
45
48
const FlexWrapper = styled . div `
@@ -56,8 +59,7 @@ const ListOrientationWrapper = styled.div<{
56
59
} > `
57
60
height: ${ ( props ) => ( props . $autoHeight ? "auto" : "100%" ) } ;
58
61
display: flex;
59
- flex-direction: ${ ( props ) => ( props . $isHorizontal && ! props . $isGrid ? "row" : "column" ) } ;
60
- height: 100%;
62
+ flex-direction: ${ ( props ) => ( props . $isHorizontal ? "row" : "column" ) } ;
61
63
` ;
62
64
63
65
type MinHorizontalWidthContextType = {
@@ -189,7 +191,8 @@ export function ListView(props: Props) {
189
191
) ;
190
192
const horizontalGridCells = useMemo ( ( ) => children . horizontalGridCells . getView ( ) , [ children . horizontalGridCells ] ) ;
191
193
const autoHeight = useMemo ( ( ) => children . autoHeight . getView ( ) , [ children . autoHeight ] ) ;
192
- const scrollbars = useMemo ( ( ) => children . scrollbars . getView ( ) , [ children . scrollbars ] ) ;
194
+ const showHorizontalScrollbar = useMemo ( ( ) => children . showHorizontalScrollbar . getView ( ) , [ children . showHorizontalScrollbar ] ) ;
195
+ const showVerticalScrollbar = useMemo ( ( ) => children . showVerticalScrollbar . getView ( ) , [ children . showVerticalScrollbar ] )
193
196
const horizontal = useMemo ( ( ) => children . horizontal . getView ( ) , [ children . horizontal ] ) ;
194
197
const minHorizontalWidth = useMemo ( ( ) => children . minHorizontalWidth . getView ( ) , [ children . minHorizontalWidth ] ) ;
195
198
const noOfColumns = useMemo (
@@ -283,12 +286,14 @@ export function ListView(props: Props) {
283
286
284
287
const childrenProps = childrenToProps ( comp . children ) ;
285
288
289
+ useMergeCompStyles ( childrenProps , comp . dispatch ) ;
290
+
286
291
// log.debug("renders: ", renders);
287
292
return (
288
293
< BackgroundColorContext . Provider value = { style . background } >
289
294
< ListViewWrapper $style = { style } $paddingWidth = { paddingWidth } $animationStyle = { animationStyle } >
290
295
< BodyWrapper ref = { ref } $autoHeight = { autoHeight } >
291
- < ScrollBar style = { { height : autoHeight ? "auto" : "100%" , margin : "0px" , padding : "0px" } } hideScrollbar = { ! scrollbars } >
296
+ < ScrollBar style = { { height : autoHeight ? "auto" : "100%" , margin : "0px" , padding : "0px" } } hideScrollbar = { horizontal ? ! showHorizontalScrollbar : ! showVerticalScrollbar } overflow = { autoHeight ? horizontal ? 'scroll' : 'hidden' : 'scroll' } >
292
297
< ReactResizeDetector
293
298
onResize = { ( width ?: number , height ?: number ) => {
294
299
if ( height ) setListHeight ( height ) ;
@@ -314,3 +319,4 @@ export function ListView(props: Props) {
314
319
</ BackgroundColorContext . Provider >
315
320
) ;
316
321
}
322
+
0 commit comments