UIPageLayout breaks when adding new elements with an invisible element inside the container

Reproduction Steps
I have a placeholder element (doesn’t seem to matter what it is) inside of a Frame. The placeholder has its “Visible” property set to false, and the Frame has a UIPageLayout inside of it. I then duplicate the placeholder element, set the duplicate’s Visibility to true, then parent it to the Frame with the page layout.

The issue appears to happen in both studio and in live games.

Repro File:
UIPageLayoutRepro2.rbxl (35.5 KB)


Example_Problem has the issue that I’m reporting. Example_Workaround uses the workaround that I mention later on in this report.

Expected Behavior
UIPageLayout should continue to function regardless of whether or not there’s a disabled element inside of it when creating new pages.

Actual Behavior
UIPageLayout just doesn’t seem to work at all. I can’t scroll through the pages nor can I code the pages to change with :Next() or :Previous(). It’s stuck on the first page.

Workaround
Cloning the placeholder element from another location works fine. I would just really prefer to be able to store the element in the same location so that I can quickly preview in studio without having to reparent it.

Issue Area: Engine
Issue Type: Display
Impact: Moderate
Frequency: Constantly


Edit (October 12th 2021): I’m not sure if there have been any changes made yet, but scrolling with a UIPageLayout seems to have gotten worse since I created this post. In the gif example that I posted previously you can see that I can smoothly scroll between pages with the workaround. Now I seem to have to scroll my mouse wheel multiple times in a row in order to get the page to progress, even in a frame with pages that are not being created on the fly. Having to scroll so hard like this in order to advance the page sometimes causes it to skip multiple pages, which obviously isn’t ideal behavior.

12 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

3 Likes

Hi @Scriptos , we have rolled out a fix for this issue, please verify on your end and let us know if it’s not fixed. Thank you!

2 Likes

Sorry to revive an old topic, but I seem to be experiencing this same or a similar issue with UIPageLayouts. In my case, I have a parent Frame, a UIPageLayout inside that, and a number of ScrollingFrames which contain the content for each of my pages.

I have two sample ScrollingFrame pages that are made invisible at the start of my script and cloned as necessary based on data stored in a module script for what pages to display. Those clones are parented into the same location as the samples and made visible.

image

If I use UIPageLayout:JumpTo() and specify the page, it seems to work properly and navigate to that page, but if I use UIPageLayout:JumpToIndex(), then all of the pages seem to be offset by maybe 3 pages to the left, probably because of the 3 pages I added.

https://gyazo.com/6ce421a5a94b8e197fd3259cb0dcdfd8

Just to avoid confusion, I have 3 pages, but the navigation is intentionally limited to the first two, as the second is a quiz page which requires answering before continuing. I have verified that all pages and all elements inside pages are visible, except for the sample pages, but this issue persists.

A workaround I’ve found for this is simply taking advantage of the fact that :JumpTo() works fine and using that to get it to sort of “refresh” the UIPageLayout before using :JumpToIndex(). Basically, I run UIPageLayout:JumpTo(UIPageLayout.CurrentPage), which shouldn’t change anything, if it was actually showing the correct page in the first place, but it ends up fixing the issue. From that point, the 3 page offset is removed and :JumpToIndex() works perfectly fine.

https://gyazo.com/5264bfd6fe7749c558218b8bacb45481

Hi @Knineteen19 , thanks for providing the feedback with details. I would recommend that you create a new bug report with these repro instructions and a repro file as well, since this issue from OP has been closed. Thank you!

1 Like