-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: Tab view height auto expand #1198
fix: Tab view height auto expand #1198
Conversation
Providing more context: example without <TabView
navigationState={{index, routes}}
renderScene={renderScene}
onIndexChange={setIndex}
/>
// style output on SceneView: {"style": [undefined, {"bottom": 0, "height": undefined, "left": 0, "position": "absolute", "right": 0, "top": 0, "width": undefined}]} example with <TabView
sceneContainerStyle={{
width: 500,
height: 500,
}}
navigationState={{index, routes}}
renderScene={renderScene}
onIndexChange={setIndex}
/>
// style output on SceneView: {"style": [{"height": 500, "width": 500}, {"bottom": 0, "height": undefined, "left": 0, "position": "absolute", "right": 0, "top": 0, "width": undefined}]} Not sure where that default style value is coming from tbh |
I try you project,TabView in SectionList Component, isn't fix my problem. |
Try this branch https://github.com/knockaway/react-native-tab-view/tree/forked-3.0.2 |
Is there an issue with @daniel112 solution? Can we get this merged? |
How does renaming the prop from |
But also check this comment: #1198 (comment) Otherwise this PR actually introduces a different bug |
@daniel112 that doesn't explain why changing the prop name is necessary. |
anyway, this PR doesn't explain any of the changes and doesn't provide any demos of what it fixes, so I'm leaning towards closing it. if someone can open a new PR providing a better explanation and demos etc. then I'll review that. |
@satya164 because passing custom styles into "sceneContainerStyles" cannot actually override the position or size (height/width) styles I agree this PR is still missing some changes. |
Still don't understand how just changing the name from |
Really waiting for the fix asap can't update react-native due to this need version 0.66.0 |
Whether you understand or not, the fact is it works. Merge it already, instead of ego fighting against it. |
I think you should really reconsider your tone when you expect people to do free work for you in the future. If you really need this feature just fork the project or use But don't be that person who tries to boss around OSS maintainers. |
I understand! Changing the prop name from style to containerStyle fixes the issue because, for some reason, the style was passing in the properties of StyleSheet.absoluteFill. example console.log in render function of SceneView:
i have applied the patch above to workaround it for now but doesn't take into account #1198 (comment) |
Changing the name fixes the tab height issue not sure why but it does work. |
@satya164 I think the root of this issue because For ios:
and take a look closer at version react-native-pager-view 5.4.24 which this package is using
You can see that they are overriding style props, and this style will be passed into children props by render function Therefore, this PR changes style to different name will actually work. Other than this fix, we can fix the utils above from react-native-pager-view. |
Motivation
TabView's height does not expand anymore to the content size in version 3
A different approach would be to refactor
SceneView
component to be a functional componentResolves: #1178