Closed Kerumen closed 2 months ago
@Kerumen how did you add the padding style to see this issue?
I'm getting the following result without the need for this PR:
With this setup:
<Tabs.Container
renderHeader={Header}
headerHeight={HEADER_HEIGHT}
renderTabBar={(props) => (
<MaterialTabBar
{...props}
scrollEnabled
style={{ paddingHorizontal: 30 }}
/>
)}
>
<Tabs.Tab name="article" label="Article">
<Tabs.ScrollView>
<ArticleContent />
</Tabs.ScrollView>
</Tabs.Tab>
</Tabs.Container>
If you have a lot of tabs, the last tab is cropped one when you put the paddingHorizontal
as style
on the MaterialTabBar
. To fix it, I've used contentContainerStyle
and it works fine but then there is the indicator issue when there is only one tab.
Merged. Thank you for the PR!
In my app I added some container style with padding to have a specific display for the tabs. When there is only one tab, the indicator is not shifted accordingly. This is due to the
itemsLayout.length > 1
condition and theundefined
value oftransform
. The same way as it's done for thewidth
, I changed thetransform
to match the first item of theitemsLayout
array if there is only one tab.