Search Issue Tracker

By Design

By Design in 6000.5.X

Votes

0

Found in

6000.0.67f1

6000.3.8f1

6000.4.0b8

6000.5.0a7

Issue ID

UUM-135213

Regression

No

Data Source is set to incorrect Visual Element when an Item Template is used

How to reproduce:
1. Open the attached “IN-134938” project
2. In the Project tab, select the “GameSettings” asset
3. In the Inspector, click “+” to add a new element
4. Notice a warning is thrown in the Console
5. Focus the UI Toolkit Debugger tab
6. Press the Pick Element button
7. Click on the newly created Text Field in the Inspector
8. Observe Data Source on TextField and TemplateContainer Visual Elements

Actual result: TemplateContainer has Data Source assigned
Expected result: TextField has Data Source assigned

Reproducible with: 2023.3.0a2, 6000.0.68f1, 6000.3.10f1, 6000.4.0b10, 6000.5.0a7
Couldn’t test with: 2023.2.0a6 (VisualElement does not contain definition for “dataSource”)

Reproducible on: macOS 26.3 (M1 Pro)
Not reproducible on: No other environments tested

  1. Resolution Note:

    Thank you for reporting a bug to Unity.

    After reviewing the behavior, we've confirmed it aligns with the current design and intended use of the feature. We understand this may differ from your expectations or workflow.

    We will close this case as 'As Designed.' If you have feedback on how the feature could better meet your needs, please let us know - we value your input and consider it in future improvements.

    Additional information:
    When using the ListView, if you set the `binding-source-selection-mode` to AutoAssign, it will set the data source (itemsSource) and data source path (index) of each individual item being displayed on the first visual element related to the item. In your case, you are using `makeItem` with a non-reorderable ListView, so the data source and data source path will be assigned the element returned by cloning the VisualTreeAsset, which will be a TemplateContainer and not the TextField.

  2. Resolution Note (6000.5.X):

    Thank you for reporting a bug to Unity.

    After reviewing the behavior, we've confirmed it aligns with the current design and intended use of the feature. We understand this may differ from your expectations or workflow.

    We will close this case as 'As Designed.' If you have feedback on how the feature could better meet your needs, please let us know - we value your input and consider it in future improvements.

    Additional information:
    When using the ListView, if you set the `binding-source-selection-mode` to AutoAssign, it will set the data source (itemsSource) and data source path (index) of each individual item being displayed on the first visual element related to the item. In your case, you are using `makeItem` with a non-reorderable ListView, so the data source and data source path will be assigned the element returned by cloning the VisualTreeAsset, which will be a TemplateContainer and not the TextField.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.