UIPageLayout CurrentPage incorrect if items not already sorted upon insertion

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)



I’ll look into this.


Further information:

  • 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

Is this issue still happening? I think one of my flag flips may have fixed it, since I can’t reproduce it anymore.

Still occurring for me. Version, 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.

This bug should be fixed now.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.