AppGrid: goToPage doesn't work for newly created pages when animations are disabled
This bug is a side-effect of commit 7bd98f3f.
Prerequisites
Animations must be disabled.
Steps to reproduce
- open the AppGrid
- go to the last page
- drag an icon
- drop the icon over the nextPageIndicator in order to create a new page
Expected behavior
A new page is created and we automatically switch to it
Actual behavior
A new page is created but we end up in a mixed state without switching to it
Notes
After some investigation, I think that the issue is that when we set the new adjustment value here the adjustment upper value has not changed yet. Maybe because with animation disabled we set the value right away without waiting for the relayout to happen.
For example, when we are about to create the fourth page, newValue
is 2400
but the adjustment upper value is still 2400
instead of 3200
.