Search Issue Tracker
Fixed in 1.0.0-preview.8
Votes
0
Found in [Package]
1.0.0-preview.6
Issue ID
1274846
Regression
No
UI Builder deletes the content of UXML files when dragging elements which cause 'InvalidOperationException'
How to reproduce:
1. Open the attached project (pbag-minimal.zip)
2. From the UI Builder Standard Library choose a 'Visual Element' Container and drag it in 'UXML_ItemInfo.uxml' on the '#unity-content-container'
3. Drag 'Visual Element' on 'ListView'
4. In the Library switch to the Project tab
5. Right-click on 'UXML_Base.uxml' and select 'open in UIBuilder' (changes have to be saved)
Expected result: the content of 'UXML_Base.uxml' didn't change
Actual result: the content of 'UXML_Base.uxml' is deleted completely and 'UXML_ItemInfo.uxml' is deleted partially
Reproducible with: 1.0.0-preview.1, 1.0.0-preview.5, 1.0.0-preview.6 (2019.4.10f1, 2020.1.5f1, 2020.2.0b3, 2021.1.0a1)
Could not test with: 2018.4.27f1 (package not compatible)
Notes:
1. Started getting errors at step 3: 'InvalidOperationException: You can't add directly to this VisualElement. Use hierarchy.Add() if you know what you're doing.'
2. Doesn't only reproduce with Visual Element but with other Containers and Controls
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Shader Graph Node information is briefly displayed in Graph Inspector when clicking on Category in the Blackboard
- Module installation fails with "Download failed: Validation Failed" errors when using beta.2 Hub version
- JsonConvert conversion fails trying to call GetCallbackMethodsForType when [OnDeserialized] is used in a class
- Shader Graph Category dropdown cannot be expanded/collapsed when clicking on the text
- Different text alignment in the column header in Entities "System" window
Resolution Note (fix version 1.0.0-preview.8):
ListView is not designed to have any element added to it as child elements. The UI Builder was incorrectly allowing this. As soon as there was a refresh, ListView would reset its contents and delete any manually added elements. In UI Builder 1.0.0-preview.8, this was addressed by not allowing the addition of child elements to any such closed elements (elements that have their contentContainer set to null).