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)
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.