Skip to content

tabbar text fix#8288

Merged
markdevocht merged 1 commit intomasterfrom
bugfix/iOS26-tabbar-text
May 5, 2026
Merged

tabbar text fix#8288
markdevocht merged 1 commit intomasterfrom
bugfix/iOS26-tabbar-text

Conversation

@markdevocht
Copy link
Copy Markdown
Contributor

Fix iOS 26 bottom tab item title layout on first paint

Context: On iOS 26, UITabBar item titles can be laid out wrong on the first pass (e.g. too low or clipped). Changing the selected tab corrects the layout. Using tabsAttachMode: 'together' alone does not fix it, so this is not only an afterInitialTab attach-order issue.

What changed

  • One-time tab selection pass in RNNBottomTabsController: after the bar appears, programmatically set selectedIndex to each tab, then restore the initial index, inside UIView performWithoutAnimation.
  • Runs on iOS 26+ only, once per controller (_rnnDidApplyInitialTabBarSelectionFix).
  • Deferred with dispatch_async to the main queue so tab children are attached first.
  • _rnnSuppressTabSelectionEvents: while cycling, skip BottomTabPressed / BottomTabSelected and return YES from shouldSelectViewController: so the cycle is not blocked by per-tab options (e.g. selectTabOnPress).
  • No tabBar layoutIfNeeded in the loop; selection changes are enough.
  • __weak RNNBottomTabsController *weakSelf for the async block (explicit type in .mm).

Tab bar appearance in init

  • Single iOS 13+ path: configureWithOpaqueBackground, backgroundEffect = nil, systemBackgroundColor, scrollEdgeAppearance on iOS 15+, non-translucent (no separate iOS 26 configureWithDefaultBackground in this controller).

Files

  • ios/RNNBottomTabsController.mm

How to verify

  • Run the playground on an iOS 26.1 simulator with a bottom tabs root; tab titles should look correct before any manual tab change.
  • Confirm there are no extra BottomTabSelected / BottomTabPressed events for the internal cycle; real user taps still emit as usual.

@markdevocht markdevocht merged commit 083bfef into master May 5, 2026
3 checks passed
@markdevocht markdevocht deleted the bugfix/iOS26-tabbar-text branch May 5, 2026 06:14
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.

1 participant