fix(ios): add Auto Layout constraints to RNNReactButtonView#8299
Open
IsaacIsrael wants to merge 1 commit into
Open
fix(ios): add Auto Layout constraints to RNNReactButtonView#8299IsaacIsrael wants to merge 1 commit into
IsaacIsrael wants to merge 1 commit into
Conversation
On iOS 26 the Liquid Glass navigation bar wraps custom-view bar button items in several internal layout containers. Without explicit size constraints the wrapper views can collapse to zero height after a pop → tab-switch → tab-switch → push cycle, making the React button invisible. - Guard all new logic behind @available(iOS 26.0, *) AND a runtime check for UIDesignRequiresCompatibility (compatibility mode disables Liquid Glass and uses the legacy view hierarchy) - Set translatesAutoresizingMaskIntoConstraints = NO - Add width/height constraints at UILayoutPriorityDefaultHigh - Update constraints in didMountComponentsWithRootTag: after sizeToFit Co-authored-by: Cursor <cursoragent@cursor.com>
d969c88 to
fd43bcc
Compare
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.
Problem
On iOS 26, the Liquid Glass navigation bar wraps
UIBarButtonItem.customViewin several internal layout containers (_UITAMICAdaptorView,_TtCC5UIKit19NavigationButtonBar15ItemWrapperView, etc.). Without explicit size constraints, these wrappers can collapse to zero height after a pop → tab-switch → tab-switch → push cycle, making the React-rendered button disappear.Solution
translatesAutoresizingMaskIntoConstraints = NOonRNNReactButtonViewwidthAnchor/heightAnchorconstraints atUILayoutPriorityDefaultHigh(750) to avoid conflicts with UIKit's internal constraintsdidMountComponentsWithRootTag:aftersizeToFitto reflect the measured React surface size<React/RCTSurface.h>for surface accessTest plan
UIBarButtonItem)Made with Cursor