Skip to content

fix(ios): prevent icon animation in TabGroup when closing modal windows#14412

Open
m1ga wants to merge 2 commits intomainfrom
iOSTabbarIcon
Open

fix(ios): prevent icon animation in TabGroup when closing modal windows#14412
m1ga wants to merge 2 commits intomainfrom
iOSTabbarIcon

Conversation

@m1ga
Copy link
Copy Markdown
Contributor

@m1ga m1ga commented Mar 24, 2026

var win1 = Ti.UI.createWindow();
var win2 = Ti.UI.createWindow();
win1.addEventListener("click", function() {
  var win3 = Ti.UI.createWindow();  
  win3.open({modal:true})
})
var tab1 = Ti.UI.createTab({window: win1,icon:"/images/appicon.png",title: 'Blue'});
var tab2 = Ti.UI.createTab({window: win2,icon:"/images/appicon.png",title: 'Red'});
tabGroup = Ti.UI.createTabGroup({tabs: [tab1, tab2]});
tabGroup.open();

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?

@m1ga m1ga marked this pull request as draft March 24, 2026 14:56
@m1ga m1ga marked this pull request as ready for review March 24, 2026 15:32
Comment on lines +83 to +98
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;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prashantsaini1 Think you'll have to check that as that one was generated from your AI

Copy link
Copy Markdown
Contributor

@prashantsaini1 prashantsaini1 Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants