fix: apply headerTintColor to native stack bar button items on iOS 26 - #13228
Open
Priyanshu0007 wants to merge 2 commits into
Open
fix: apply headerTintColor to native stack bar button items on iOS 26#13228Priyanshu0007 wants to merge 2 commits into
Priyanshu0007 wants to merge 2 commits into
Conversation
✅ Deploy Preview for react-navigation-example ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13228 +/- ##
==========================================
+ Coverage 72.24% 77.92% +5.67%
==========================================
Files 238 264 +26
Lines 8391 10722 +2331
Branches 3480 4442 +962
==========================================
+ Hits 6062 8355 +2293
- Misses 2274 2304 +30
- Partials 55 63 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12932
Motivation
On iOS 26 (Liquid Glass), UIKit isolates
UIBarButtonItems inside shared capsule toolbars so they do not inheritnavigationBar.tintColor. Instead, iOS 26 requirestintColorto be set explicitly on each individualUIBarButtonItem.In
@react-navigation/native-stack,processBarButtonItemswas not forwardingtintColortoheaderLeftBarButtonItemsandheaderRightBarButtonItemsunless explicitly set per-item in screen options. Because of this, custom header items and buttons remained in the default system label color (black) on iOS 26 whenheaderTintColorwas provided.This PR updates
processBarButtonItemsinuseHeaderConfigProps.tsxto automatically defaulttintColorto the screen's resolvedtintColor(fromheaderTintColor), ensuring consistent header item tinting across iOS 26, older iOS versions, and Android.Test plan
headerTintColoron a native stack screen (e.g.headerTintColor: "#198a00ff").unstable_headerLeftItemsandunstable_headerRightItemswith buttons and menus.pnpm typecheck(Passed)pnpm lint(Passed)pnpm test(All 81 test suites passed)