@@ -35,8 +35,6 @@ const FooterWrapper = styled.div`
35
35
` ;
36
36
37
37
const BodyWrapper = styled . div < { $autoHeight : boolean } > `
38
- overflow: auto;
39
- overflow: overlay;
40
38
height: ${ ( props ) => ( props . $autoHeight ? "100%" : "calc(100% - 32px)" ) } ;
41
39
` ;
42
40
@@ -55,12 +53,23 @@ const ListOrientationWrapper = styled.div<{ $isHorizontal: boolean, $autoHeight
55
53
height: 100%;
56
54
` ;
57
55
58
- const MinHorizontalWidthContext = createContext ( 0 ) ;
56
+ const MinHorizontalWidthContext = createContext ( {
57
+ horizontalWidth : '100%' ,
58
+ minHorizontalWidth : '100px' ,
59
+ } ) ;
59
60
60
61
const ContainerInListView = ( props : ContainerBaseProps ) => {
61
- const minHorizontalWidth = useContext ( MinHorizontalWidthContext ) ;
62
+ const {
63
+ horizontalWidth,
64
+ minHorizontalWidth
65
+ } = useContext ( MinHorizontalWidthContext ) ;
62
66
return (
63
- < div style = { { width : minHorizontalWidth > 0 ? `${ minHorizontalWidth } px` : "100%" } } >
67
+ < div
68
+ style = { {
69
+ width : horizontalWidth ,
70
+ minWidth : minHorizontalWidth ,
71
+ } }
72
+ >
64
73
< InnerGrid
65
74
{ ...props }
66
75
emptyRows = { 15 }
@@ -79,11 +88,23 @@ type ListItemProps = {
79
88
scrollContainerRef ?: RefObject < HTMLDivElement > ;
80
89
minHeight ?: string ;
81
90
unMountFn ?: ( ) => void ;
82
- minHorizontalWidth : number ;
91
+ minHorizontalWidth : string ;
92
+ horizontalWidth : string ;
83
93
} ;
84
94
85
- function ListItem ( { minHorizontalWidth, ...props } : ListItemProps ) {
86
- const { itemIdx, offset, containerProps, autoHeight, scrollContainerRef, minHeight } = props ;
95
+ function ListItem ( {
96
+ minHorizontalWidth,
97
+ horizontalWidth,
98
+ ...props
99
+ } : ListItemProps ) {
100
+ const {
101
+ itemIdx,
102
+ offset,
103
+ containerProps,
104
+ autoHeight,
105
+ scrollContainerRef,
106
+ minHeight
107
+ } = props ;
87
108
88
109
// disable the unmount function to save user's state with pagination
89
110
// useEffect(() => {
@@ -94,14 +115,23 @@ function ListItem({ minHorizontalWidth, ...props }: ListItemProps) {
94
115
// }, []);
95
116
96
117
return (
97
- < MinHorizontalWidthContext . Provider value = { minHorizontalWidth } >
118
+ < MinHorizontalWidthContext . Provider
119
+ value = { {
120
+ horizontalWidth,
121
+ minHorizontalWidth
122
+ } }
123
+ >
98
124
< ContainerInListView
99
125
layout = { containerProps . layout }
100
126
items = { gridItemCompToGridItems ( containerProps . items ) }
101
127
positionParams = { containerProps . positionParams }
102
128
// all layout changes should only reflect on the commonContainer
103
129
dispatch = { itemIdx === offset ? containerProps . dispatch : _ . noop }
104
- style = { { height : "100%" , backgroundColor : "transparent" , flex : "auto" } }
130
+ style = { {
131
+ height : "100%" ,
132
+ backgroundColor : "transparent" ,
133
+ flex : "auto" ,
134
+ } }
105
135
autoHeight = { autoHeight }
106
136
isDroppable = { itemIdx === offset }
107
137
isDraggable = { itemIdx === offset }
@@ -181,8 +211,7 @@ export function ListView(props: Props) {
181
211
key = { rowIdx }
182
212
style = { {
183
213
height : rowHeight ,
184
- width : 100 / noOfColumns + "%" ,
185
- minWidth : minHorizontalWidth ,
214
+ width : '100%' ,
186
215
} }
187
216
>
188
217
< FlexWrapper >
@@ -217,7 +246,8 @@ export function ListView(props: Props) {
217
246
scrollContainerRef = { ref }
218
247
minHeight = { minHeight }
219
248
unMountFn = { unMountFn }
220
- minHorizontalWidth = { horizontal ? minHorizontalWidth : 0 }
249
+ horizontalWidth = { `${ 100 / noOfColumns } %` }
250
+ minHorizontalWidth = { horizontal ? minHorizontalWidth : '0px' }
221
251
/>
222
252
) ;
223
253
} ) }
0 commit comments