react-native-tab-view
react-native-tab-view copied to clipboard
Allow children dictate height
Please provide enough information so that others can review your pull request:
Motivation A follow up to this comment: https://github.com/satya164/react-native-tab-view/pull/1198#issuecomment-889945740
There exists some use case where we want to embed this tab view within a view (typically a scroll view), doing so does not properly set the height UNLESS you specifically give TabView a static height.
In some cases, our content needs to be dynamic so setting a specific height prior to rendering the content will not look great.
This PR covers the edge case where:
- you want to embed a tabview that's not full screen and/or is within another view
- your content is dynamic is height
Test plan
- I've added an example to the
/examplefolder to better visualize this, but I also have been using this modified version in my production application
Before changes
https://user-images.githubusercontent.com/3317835/127685333-27d745f6-3614-44b0-aa9b-dc0febd25d39.mp4
After changes
https://user-images.githubusercontent.com/3317835/127685318-afdb8c1f-f36f-4b3b-943a-e8841032271b.mp4
https://user-images.githubusercontent.com/3317835/124084979-67bb8900-da04-11eb-842b-98980a40a798.mp4
Hey daniel112! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.
@satya164 - opening PR with examples as requested - https://github.com/satya164/react-native-tab-view/pull/1198
Hey! When will this be available? :)
I had this issue which pretty much stopped me from being able to use the component. I downloaded the source from the fork and it works great for me.
HI. I'm in trouble solving this issue. When will it be applied?
Don't think this fixes the issue entirely, it is working indeed, but there is this unwanted behaviour visible on an attached original video, where the height is being set only after swipe is done, and if heights of the content are different it does not look good (even more if you do swipe with a finger and you don't see any content until you release the finger). In v2 this was not the case, heights were set before swipe is done, so you could go back and forth between tabs with different heights without any visual glitches.
| Progress | Result |
|---|---|
![]() |
![]() |
Also stuck without this fix, cannot upgrade to react-navigation 6, what is blocking?
It's such a shame this fix is not merged yet. More than 6 months after.
please merge this! I lost days working around this issue. This branch fixed my issue with zero code changes on my end!
This PR is fixing the problem with the height of screens. I am using the fork version at the moment and hopefully this will be merged soon.
Hey @daniel112 can you sync this with the main branch? So we can get back to working on this and merge it.
Hey @daniel112 can you sync this with the main branch? So we can get back to working on this and merge it.
@okwasniewski I no longer have access to the forked repo. So I forked it on my personal account and have an identical updated PR here: https://github.com/satya164/react-native-tab-view/pull/1383
feel free to close this one when you're ready

