stride3d / stride3d/stride

UI Stack panels in Visual Tree not updating order

Open
#2,324 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Official Release/GitHub (please choose appropriate option)
Official Release

Version: Version number and/or git branch
Stride Game Studio 4.2.0.2149
.NET 8.0.2

Platform(s): Does the problem occur on Windows, Android...?
Windows 10

Describe the bug
In the UI Editor using a UILibrary the StackPanel's visual tree order does not control the order the UI elements are displayed in the UI visual editor.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new StackPanel in a UILibrary, no setting changes required
  2. Drag two TextBlocks onto the StackPanel in the Visual Tree
  3. Change the text of the TextBlocks to distinct values, like "1" and "2"
  4. In the Visual Tree drag the first TextBlock above the second TextBlock
    At this point the first TextBlock in the Visual Tree will be the second value in the preview window.

The work around for this is to use the Visual Tree to select and drag all elements out of the StackPanel and then drag and drop all elements back into the StackPanel

Expected behavior
The UI elements in the Visual Tree get drawn to visual UI editor in the same order that a StackPanel would display it's children elements

Screenshots
Here is the end result of the Reproduced steps
image

Log and callstacks
N/A

Additional context
This was done an an existing project, have not tried it on a new project. I have tested in a new UILibrary.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the Stride Game Studio UI Editor using a UILibrary, a StackPanel, and two distinct TextBlocks, then inspect how Visual Tree reordering affects the preview. Done means the elements render in the preview in the same order shown by the Visual Tree after reordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.