@codeleap/mobile 3.15.8 → 3.16.2
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
|
@@ -43,7 +43,7 @@ export type PagerProps = React.PropsWithChildren<{
|
|
|
43
43
|
renderPageWrapper?: React.FC<PageProps>
|
|
44
44
|
pageWrapperProps?: any
|
|
45
45
|
width?: number
|
|
46
|
-
onScroll?: (event: ScrollEvent, args: { isLeft: boolean; isRight: boolean; x: number
|
|
46
|
+
onScroll?: (event: ScrollEvent, args: { isLeft: boolean; isRight: boolean; x: number }) => void
|
|
47
47
|
/** If TRUE render page, nextPage and prevPage only */
|
|
48
48
|
windowing?: boolean
|
|
49
49
|
scrollRightEnabled?: boolean
|
|
@@ -136,13 +136,13 @@ export const Pager = (pagerProps: PagerProps) => {
|
|
|
136
136
|
if (waitEventDispatch.current === true) return null
|
|
137
137
|
|
|
138
138
|
waitEventDispatch.current = true
|
|
139
|
-
|
|
139
|
+
|
|
140
140
|
const x = event?.nativeEvent.contentOffset.x
|
|
141
141
|
const toPage = Math.floor(((Math.round(x)) / Math.round(width)))
|
|
142
142
|
|
|
143
143
|
const length = childArr.length - 1
|
|
144
144
|
|
|
145
|
-
if (toPage >= length
|
|
145
|
+
if (toPage >= length && TypeGuards.isFunction(onSwipeLastPage) && page >= length) {
|
|
146
146
|
onSwipeLastPage?.(event)
|
|
147
147
|
} else if (toPage !== page && toPage <= length) {
|
|
148
148
|
setPage(toPage)
|