File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-fluid-table" ,
3
- "version" : " 0.4.7 " ,
3
+ "version" : " 0.4.8 " ,
4
4
"description" : " A React table inspired by react-window" ,
5
5
"author" : " Mckervin Ceme <mckervinc@live.com>" ,
6
6
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ const ListComponent = forwardRef(
57
57
ref : React . ForwardedRef < TableRef >
58
58
) => {
59
59
// hooks
60
+ const heightRef = useRef ( - 1 ) ;
60
61
const timeoutRef = useRef ( 0 ) ;
61
62
const prevRef = useRef ( width ) ;
62
63
const cacheRef = useRef < any > ( { } ) ;
@@ -172,6 +173,15 @@ const ListComponent = forwardRef(
172
173
// check if we should use the row width when width changes
173
174
useEffect ( ( ) => shouldUseRowWidth ( ) , [ width ] ) ;
174
175
176
+ // every time the height changes, clear the height cache
177
+ useLayoutEffect ( ( ) => {
178
+ if ( heightRef . current >= 0 && heightRef . current !== height ) {
179
+ clearSizeCache ( - 1 , true ) ;
180
+ }
181
+
182
+ heightRef . current = height ;
183
+ } , [ height ] ) ;
184
+
175
185
// manually alter the height of each row if height is incorrect
176
186
// to help with flicker on resize
177
187
useLayoutEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments