Search Issue Tracker

By Design

Votes

0

Found in

2021.3.19f1

2022.2.8f1

2023.1.0b5

2023.2.0a3

Issue ID

UUM-27655

Regression

No

Multiple foldouts expand and their elements get mixed up when scrolling a list of foldouts

-

How to reproduce:
1. Open the attached Project "UiToolkit" and load Scene "SampleScene"
2. Enter Play Mode
3. Expand the first element of the orange list
4. Scroll the orange list down

Expected result: Only the first element remains expanded and the elements of the foldout remain under the first foldout
Actual result: An additional foldout gets expanded and the elements of the first foldout are displayed alongside the elements of the newly expanded foldout

Reproducible with: 2021.3.19f1, 2022.2.8f1, 2023.1.0b5, 2023.2.0a3
Could not test with: 2020.3.45f1

Reproduced on:
- MacOS (Intel) Editor

Notes:
- The foldout that gets expanded is the one that enters the visible area in the ScrollView, as the first foldout is leaving the visible area

  1. Resolution Note:

    You would need to set the foldout's value in your UIFoldoutEntryController's `SetitemData`.

    `m_Folder.SetValueWithoutNotify(itemData.isExpanded);`

    This is assuming you would track the expanded state with a boolean variable named `isExpanded` in the MenuItem class.

    You can have a look at the documentation here: https://docs.unity3d.com/Manual/UIE-create-list-view-complex.html
    It would be similar to how they restore the value of the slider in the example. It also shows how you can register to the value changed event to keep the value up to date in your data.

    Please use the forum if you need more information. https://forum.unity.com/forums/ui-toolkit.178/

Add comment

Log in to post comment