Commit ef60d04
authored
Sync UI children on
# Objective
For context:
> Yeah it seems like it would be a `bevy_ui` issue, which just becomes
easy to hit since `spawn_scene` is deferred. You end up with an invalid
(has non-Node parent) Node until the scene is resolved and spawned. And
it seems like the UI systems can’t handle the parent adding Node, making
the child valid
https://discord.com/channels/691052431525675048/1264881140007702558/1397443915900256338
- The UI layout systems do not take node addition into account when
deciding to sync children
- Multiple people have encountered this when evaluating the BSN draft PR
which involves spawning scenes asynchronously.
## Solution
- Added a check for `node.is_added()` alongside the
`children.ui_children.is_changed()` check
## Testing
- Added a new test case: `node_addition_should_sync_children`
---Node addition (#20266)1 parent 9445481 commit ef60d04
1 file changed
+26
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | | - | |
| 157 | + | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
652 | 673 | | |
653 | 674 | | |
654 | 675 | | |
| |||
0 commit comments