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
- “You may not pass in objects that are already persistent” error is thrown when entering the Play Mode and the "Active Input Handling" system was changed in a custom Build Profile
- [Linux] Assertion failed on expression 'success && actual == size' error is thrown when building project to another partition with a different file system
- Import Activity window shows "(None)" in the Asset field when changing the path of the asset
- Material setting changes when saving the Scene
- Sprite Mask's Alpha Cutoff value dragging is too sensitive
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).