fix(ios): prevent icon animation in TabGroup when closing modal windows#14412
fix(ios): prevent icon animation in TabGroup when closing modal windows#14412hansemannn merged 6 commits intomainfrom
Conversation
| UITraitCollection *currentTraitCollection = controller.traitCollection; | ||
|
|
||
| if (currentTraitCollection == nil) { | ||
| currentTraitCollection = rootWindow.hostingController.traitCollection; | ||
| } | ||
|
|
||
| if (currentTraitCollection == nil) { | ||
| return; | ||
| } | ||
|
|
||
| if ((lastTabBarTraitCollection != nil) | ||
| && ![currentTraitCollection hasDifferentColorAppearanceComparedToTraitCollection:lastTabBarTraitCollection] | ||
| && (currentTraitCollection.horizontalSizeClass == lastTabBarTraitCollection.horizontalSizeClass) | ||
| && (currentTraitCollection.verticalSizeClass == lastTabBarTraitCollection.verticalSizeClass)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
What's the reason behind the trait collection check? If it's different, the underlaying issue should be in the presented modal state, not the return state.
There was a problem hiding this comment.
@prashantsaini1 Think you'll have to check that as that one was generated from your AI
There was a problem hiding this comment.
The didChangeTraitCollection is triggered only for ≥ 26, not below this version. It seems something must have changed internally in how the iOS handles it now for different classes (so we only compare it for horizontal + vertical sizes and color appearances for system dark/light modes).
|
made some changes after checking the file with Claude:
|
|
@m1ga Were you able to test this already? If so, I'll give it another review and we're good to go! |
|
yes, with the test example from the first post: sim.mov
and with another real app where I've noticed the issue. All work fine |
hansemannn
left a comment
There was a problem hiding this comment.
Excellent, thank you!
Current issue:
iphone_tabgroup.mov
Icons will animate when you close the window. When removing that line it won't update the icons.
Also tested a normal app. Looks fine and shows the correct icons without issues.
Any thoughts if that code is still needed?