Steps to reproduce:
- Open the attached project
- Open the SampleScene
- Expand the PanelRenderer object in the Hierarchy
- Press the > button to open the UXML asset in the UI Viewport window
- Dock the UI Viewport's Style Sheets window so it remains visible
- Right-click on any UI element in the UI Viewport window and select the Open in UI Builder option
- In the UI Builder's window, remove any selector from the test.USS file
- Observe the UI Viewport's Style Sheets window
Actual results: Empty selector is left behind in place of the deleted selector
Expected results: The selector is fully removed from both windows
Reproducible with versions: 6000.6.0b1, 6000.6.0b5, 6000.7.0a3
Can’t test with versions: 6000.0.79f1, 6000.3.20f1, 6000.5.4f1, 6000.6.0a7 (UI Viewport window not available)
Tested on (OS): macOS 26.5.2
Notes:
- Workaround - manually re-order the Selectors in the UI Builder's Stylesheets view. This updates both windows, and empty selectors are removed from the UI Viewport's StyleSheets tab
- If a Selector is deleted from the UI Viewport's StyleSheets list in Step 7, it will remain in the UI Builder's window. It won't turn into an empty selector like in the UI Viewport's StyleSheets case and will retain its name, but interacting with it in the UI Builder window will start throwing NullReferenceExceptions. This ghost selector in the UI Builder window cannot be deleted