Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { ViewPagerTabGroupProps } from './ViewPagerTabGroupProps';
import { withViewPagerTabGroupVariation } from './ViewPagerTabGroupProps';

export const ViewPagerTabGroup = withViewPagerTabGroupVariation(
({ children, tabId, testId, onTabChange, tabSpacing }) => (
({ children, tabId, testId, onTabChange, tabSpacing, native_swipeEnabled = true }) => (
<TabView
tabId={tabId}
testId={testId}
Expand All @@ -29,6 +29,7 @@ export const ViewPagerTabGroup = withViewPagerTabGroupVariation(
</VStack>
)}
onTabChange={onTabChange}
native_swipeEnabled={native_swipeEnabled}
>
{children}
</TabView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type ViewPagerTabGroupProps = {
tabId?: string;
onTabChange?: () => void;
testId?: string;
native_swipeEnabled?: boolean;
};

export const withViewPagerTabGroupVariation = withVariation<ViewPagerTabGroupProps>('ViewPagerTabGroup')();
3 changes: 2 additions & 1 deletion packages/vibrant-core/src/lib/TabView/TabView.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { TabViewItemProps } from '../TabViewItem';
import { withTabViewVariation } from './TabViewProps';

export const TabView = withTabViewVariation(
({ children, tabId, onTabChange, renderTobBarContainer, renderTobBarItem }) => {
({ children, tabId, onTabChange, renderTobBarContainer, renderTobBarItem, native_swipeEnabled = true }) => {
const childrenElement = Children.toArray(children).filter(isValidElement<TabViewItemProps>);
const [currentIndex, setCurrentIndex] = useState(
Math.max(
Expand Down Expand Up @@ -75,6 +75,7 @@ export const TabView = withTabViewVariation(
navigationState={{ index: currentIndex, routes }}
renderScene={renderScene}
onIndexChange={setCurrentIndex}
swipeEnabled={native_swipeEnabled}
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions packages/vibrant-core/src/lib/TabView/TabViewProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type TabViewProps = {
renderTobBarContainer: (props: ReactElementChildren) => ReactElement;
onTabChange?: () => void;
testId?: string;
native_swipeEnabled?: boolean;
};

export const withTabViewVariation = withVariation<TabViewProps>('TabView')();
Loading