Steps to reproduce:
- Create and open a new project
- Open 'Edit -> UI Toolkit -> Enable StyleSheet Editing Mode'
- In Project, create and open 'UI Toolkit -> Style Sheet (USS)' in UI Builder
- Expand the new USS file in UI Builder
- Expand the USS Preview below the Viewport
- Duplicate the 'VisualElement' selector in UI Builder's Hierarchy a few times
- Save the changes
- Delete one of the VisualElements
- Observe the USS preview
Actual results: The same number of VisualElements is displayed (like in step 7)
Expected results: One less VisualElement is displayed
Reproducible with versions: 6000.7.0b1, 7000.0.0a1
Can’t test with versions: 6000.0.84f1, 6000.3.24f1, 6000.6.2f1, 6000.7.0a6 (No StyleSheet Editing preview)
Tested on (OS): Windows 11 Pro (25H2)
Notes:
- USS gets dirty, however saving does nothing - upon reopening UI Builder, the deleted elements return
- Adding elements still appends code to the USS
- After reproducing, any changes done to selectors are not registered in USS code/USS preview, but are displayed in UI Builder's Inspector
- Only reproducible when using the StyleSheet Editing in UI Builder