Steps to reproduce:
1. Create a new project
2. Create a UI Button GameObject (UI > Button - TextMeshPro)
3. Undo object creation
Actual results: Only Canvas and EventSystem GameObjects get removed
Expected results: All newly created GameObjects disappear
Reproducible with versions: 2021.1.0a9, 2021.3.48f1, 2022.3.57f1
Not reproducible with versions: 2021.1.0a8, 6000.0.36f1, 6000.1.0b4, 6000.2.0a1
Tested on (OS): macOS Sequoia 15.1 (Intel), Ubuntu 20.04, Windows 11
Notes:
- Issue is reproducible with "Dropdown - TextMeshPro" and "Input Field - TextMeshPro" GameObjects as well
- Issue is not reproducible with "Text - TextMeshPro" and other GameObjects
- Issue is reproducible with keyboard shortcut and with the context option (Edit > Undo)