MixedRealityToolkit-Unity
MixedRealityToolkit-Unity copied to clipboard
Clearing VirtualizedScrollRectList doesn't always work.
Overview
I wasn't able to completely clear the list every time. Perhaps I need more info on how to properly use the OnInvisible Action.
My workaround was to add
public void ResetList()
{
SetItemCount(0);
OnValidate();
}
to a copy of the VirtualizedScrollRectList class
Expected behavior
When clearing the list with SetItemCount(0), all items should be removed every time SetItemCount(0) is used.
Actual behavior
First time the items are removed, but the second time the items remain visible in the list and ItemCount remains > 0. The new items will appear on the same position as the items still in the list, showing items through each other.
Steps to reproduce
- Add Items to the List.
- SetItemCount(0)
- Add new Items to the List.
- SetItemCount(0)
Unity editor version
2021.3.16f1
Mixed Reality Toolkit release version
MRTK3
@maluoi ? 😉