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
- Crash on AnnotationManager::CanHideLODLabels when opening the Gizmos dropdown menu
- "Default Play Mode" button does not appear in the Editor toolbar after installing Multiplayer Play Mode package
- Icon of the button that opens Player 2 window is barely visible in the Active Scenario window when using Light Editor Theme
- It is possible to disable the Low Resolution Aspect Ratios setting on non-Retina displays when the display's scale is set to a value higher than 100%
- The “Default” overlay preset is selected and not marked dirty but the overlay itself is still unsaved when deleting a different preset
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).