fix(Tabs): remove width/height 100% from TabsHost fillParent style#3663
Open
kimchi-developer wants to merge 1 commit intosoftware-mansion:mainfrom
Open
fix(Tabs): remove width/height 100% from TabsHost fillParent style#3663kimchi-developer wants to merge 1 commit intosoftware-mansion:mainfrom
kimchi-developer wants to merge 1 commit intosoftware-mansion:mainfrom
Conversation
The fillParent style on TabsHost uses `flex: 1` together with `width: '100%'` and `height: '100%'`. The explicit width/height prevents TabsHost from participating in flex layout with sibling views, because '100%' forces it to take the full parent size regardless of other flex children. This makes it impossible to place persistent UI elements (e.g. a banner ad) alongside NativeTabs in a parent flex container — the tabs always cover the full screen. Removing width/height and keeping only `flex: 1` lets the native component fill the remaining space after siblings, while the native iOS (NSLayoutConstraint pinning) and Android (MATCH_PARENT) layout still correctly sizes the tab controller within TabsHost bounds.
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.
Summary
Closes #3662
width: '100%'andheight: '100%'fromTabsHost'sfillParentstyleflex: 1, which is sufficient for the native layout constraints on both iOS and AndroidProblem
TabsHostcannot be used as a flex child alongside sibling views. The explicitwidth/height: '100%'forces it to take the full parent size, making patterns like a persistent banner above tabs impossible.Why this is safe
RNSBottomTabsHostComponentView.mmpinscontroller.viewto the host view's 4 edges viaNSLayoutConstraint— it fills whatever bounds the JS view providesTabsHost.ktusesMATCH_PARENT— same behavior, fills the parent view's boundsTabsScreenis not affected — it usesposition: 'absolute'(correct for stacking tab content)Test plan
NativeTabsin a<View style={{ flex: 1 }}>with a sibling<View>above itflex: 1still fills parent