Not signed in
Copyright © 2026 Unity Technologies
Thank you for reporting a bug to Unity. After reviewing the behavior, we've confirmed it aligns with the current design and intended use of the feature. We understand this may differ from your expectations or workflow. The current implementation of descendant and ancestor selector combiners are always compared against the "logical" parent instead of the physical element hierarchy. Thus, adding an element to a scrollView will allow it to match "ScrollView > #MyElement" even if MyElement is physically parented to the ScrollView's content container. Adding an element via hierarchy.Add (or by adding it to the contentContainer directly) bypasses the logical vs physical abstraction and, as such, will make the content container visible to the selector rule matching. You can see the difference between .parent and .hierarchy.parent in the submitted repro code: ``` paginator.Add(page1); paginator.contentContainer.Add(page2); Debug.Log($"Is same physical parent: {page1.hierarchy.parent == page2.hierarchy.parent}"); // true Debug.Log($"Is same logical parent: {page1.parent == page2.parent}"); // false ``` We are aware that this is a current limitation of our styling engine. As there is no equivalent to contentContainer on the web, we settled on this behavior from day 1 and would need to expose new combiners to test against the physical hierarchy. This might be something that we will consider in the future, but it's not in the current plans. We will close this case as 'As Designed.' If you have feedback on how the feature could better meet your needs, please let us know - we value your input and consider it in future improvements.
How to reproduce:
1. Open the “UIToolkitChecks.zip“ project
2. Open “TestContentContainer” scene
3. Enter Play Mode
4. Observe the Game view
Actual result: Both elements have different color
Expected result: Both elements have same color
Reproducible with: 2023.2.0a11, 6000.0.71f1, 6000.3.11f1, 6000.4.0f1, 6000.5.0a9, 6000.6.0a1
Could not test with: 2023.1.0a1 (Console errors)
Reproducible on: macOS 26.3.1 (M1 Max)
Not reproducible on: No other environment tested
Sign in to see your voted issues