Open DrGor opened 7 years ago
Same here
Also have seen this. Any work arounds?
@serranom , you can override the method cacheSizes
and update the size when it is significant (>1px).
I am happy to create a PR if @caseywebdev is OK with this solution.
@DrGor, hmm. well in my case, the size is flipping back and forth from 25 to 445. I think I must have something else going on. Thanks though!
First of all thanks for this great library. I came across the following defect: Browser: Chrome List type: variable Application freezes for a few seconds when scrolling. Console log message 'ReactList failed to reach a stable state.'
When
updateVariableFrame
is called and items are measured it calculatesfrom
andsize
based on item sizes. However all subsequent calls toupdateVariableFrame
(aftercomponentDidUpdate
) produce differentsize
because of one item having a slightly different size (1px bigger/smaller offsetHeight) after each rendering phase compared to previous phase. This leads to infinite loop:offsetHeight of item X = 300px => returns
size
= 4 inupdateVariableFrame
offsetHeight of item X = 301px => returnssize
= 5 inupdateVariableFrame
offsetHeight of item X = 300px => returnssize
= 4 inupdateVariableFrame
...Interestingly you have addressed this defect (slightly different
offsetHeight
) ingetItemSizeAndItemsPerRow
which is used for uniform lists only. Has anyone else experienced this 'freezing' defect with variable lists ?Possible solution: Change the cached size only if it is significant (>1px). See
cacheSizes
method.