UIPageLayout’s CurrentPage is incorrect if items are inserted with a script and are not already sorted upon insertion. If I insert them manually though the explorer or they’re already sorted when I insert them through Lua, there’s no problem.
Example of correct behavior (inserted already-sorted through Lua) (bottom TextLabel shows CurrentPage):
Example of incorrect behavior (inserted shuffled through Lua):
Here is a repro file. See the LocalScript in StarterPlayer > StarterPlayerScripts for implementation. Commenting out the shuffle resolves the issue, but as soon as shuffle is re-enabled CurrentPage becomes incorrect again. Repro.rbxl (15.4 KB)
Removing the CurrentPage forces the UIPageLayout to update the CurrentPage, so this can be used as a workaround for the time being (de/re-parent CurrentPage every time something is added)
Removing items that aren’t the CurrentPage have no effect
Still occurring for me. Version 0.296.0.130667, and I restarted Studio before testing to make sure I had the latest flags. You may need to test multiple times because out of coincidence they may have been randomly sorted into the correct order, or maybe there’s a race condition which causes this issue. When I initially made the repro this occurred to me once, but I was and still am to reproduce it consistently.