Setting a label's left or right margin to auto causes it to disappear when saving

Setting the left or right margin style of label to auto in UIBuilder causes the label to disappear and it’s inspector window to become blank after saving.

Tried to post a bug report about this, but it kept erroring out. Anyway very simple to reproduce

Open UI builder and select a new uxml. Drag a VisualElement into the hierarchy and then drag a label onto the VisualElement. Set the left or right margin property to auto. Hit Ctrl-S. Notice the inspector window for the label either goes blank right away, or selection is lost, and the inspector panel is blank when you reselect the label. Also the label is no longer renderred in the UI

Test in 2021.2b9 and 2021.2b11

Also changing the uxml hierarchy causes the uss to be marked as unsaved even though it hasn’t changed.

Someone else reported a very similar issue: Unity Issue Tracker - [UI Builder] Setting Element's Margins to auto in a newly created file completely shrinks the Element and breaks the Inspector

Would you say this is the same bug? Thanks for reporting the issue!

Yes, seems like the same problem.