@codeleap/mobile 3.2.7 → 3.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentVariants,
|
|
3
3
|
onUpdate,
|
|
4
|
+
PropsOf,
|
|
4
5
|
TypeGuards,
|
|
5
6
|
useDefaultComponentStyle,
|
|
6
7
|
useWarning,
|
|
@@ -11,6 +12,7 @@ import {
|
|
|
11
12
|
NativeScrollEvent,
|
|
12
13
|
NativeSyntheticEvent,
|
|
13
14
|
ScrollView,
|
|
15
|
+
ScrollViewProps,
|
|
14
16
|
StyleSheet,
|
|
15
17
|
} from 'react-native'
|
|
16
18
|
import { StylesOf } from '../../types/utility'
|
|
@@ -44,7 +46,7 @@ export type PagerProps = React.PropsWithChildren<{
|
|
|
44
46
|
onScroll: ScrollProps['onScroll']
|
|
45
47
|
/** If TRUE render page, nextPage and prevPage only */
|
|
46
48
|
windowing?:boolean
|
|
47
|
-
}>
|
|
49
|
+
} & ScrollViewProps>
|
|
48
50
|
|
|
49
51
|
export const Pager = (pagerProps:PagerProps) => {
|
|
50
52
|
const {
|
|
@@ -59,6 +61,7 @@ export const Pager = (pagerProps:PagerProps) => {
|
|
|
59
61
|
children,
|
|
60
62
|
windowing = false,
|
|
61
63
|
setPage,
|
|
64
|
+
scrollEnabled = true,
|
|
62
65
|
} = pagerProps
|
|
63
66
|
|
|
64
67
|
const childArr = React.Children.toArray(children)
|
|
@@ -122,15 +125,15 @@ export const Pager = (pagerProps:PagerProps) => {
|
|
|
122
125
|
|
|
123
126
|
return (
|
|
124
127
|
<ScrollView
|
|
125
|
-
{...pagerProps}
|
|
126
128
|
ref={scrollRef}
|
|
127
129
|
horizontal
|
|
128
130
|
pagingEnabled
|
|
129
131
|
onMomentumScrollEnd={handleScrollEnd}
|
|
130
132
|
scrollEventThrottle={300}
|
|
131
133
|
showsHorizontalScrollIndicator={false}
|
|
132
|
-
scrollEnabled={childArr.length > 1}
|
|
133
134
|
style={[variantStyles.wrapper, style]}
|
|
135
|
+
{...pagerProps}
|
|
136
|
+
scrollEnabled={childArr.length > 1 && scrollEnabled}
|
|
134
137
|
>
|
|
135
138
|
{childArr.map((child: PagerProps['children'][number], index) => {
|
|
136
139
|
|