Closed Alexander-Ploskin closed 1 year ago
@Alexander-Ploskin thank you very much, great to see people use this library Can you share a MRE first please? So that I can verify the bad behavior and also write tests for it
@palexdev, thank you for a quick answer. The small project in attachment. To reproduce the issue follow steps in the gif. virtualgrid-bug.zip
@Alexander-Ploskin nice catch for this nasty bug, the proposed fix was also really good, I just improved it a little to avoid unnecessary computations, see 9edb877b138c71a2511e78399ed2f6911887c54f New version will be out soon on Maven
I use
VirtualGrid
in my project. When I change cell size in a way thatmaxRows
becomes bigger thansize()
(GridState.rowsFilled()
is false), the first row is collapsed. I found that this behavior is caused byGridState.init
method, that doesn't do anything when the given ranges for rows and columns are the same. The target size also affects rows layout in my case, so the grid state should be updated in such case too.