-
Notifications
You must be signed in to change notification settings - Fork 734
Support rendering TabController inside a ScrollView (with a header) #3235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -55,6 +55,7 @@ export function registerScreens(registrar) { | |||
registrar('unicorn.components.StepperScreen', () => require('./StepperScreen').default); | |||
registrar('unicorn.components.SwitchScreen', () => require('./SwitchScreen').default); | |||
registrar('unicorn.components.TabControllerScreen', () => require('./TabControllerScreen').default); | |||
registrar('unicorn.components.TabControllerWithStickyHeaderScreen', () => require('./TabControllerWithStickyHeaderScreen').default); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to wrap screen with gestureHandlerRootHOC
@ethanshar Looks great. Left a small comment |
<TabController items={items} nestedInScrollView> | ||
<ScrollView | ||
// stickyHeaderHiddenOnScroll | ||
stickyHeaderIndices={[0, 1]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Child 0 won't be sticky here so you can also pass only '[1]' as index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Description
When rendering TabController layout inside a ScrollView, especially when having a header (see new example screen)
the layout doesn't work well
In order to support that I added the
nestedInScrollView
prop that handles the TabPages layout differentlyChangelog
Support rendering TabController inside a ScrollView (with a header) by passing
nestedInScrollView
Additional info