@codeleap/mobile 3.15.4 → 3.15.6
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
|
@@ -130,7 +130,7 @@ export const Pager = (pagerProps: PagerProps) => {
|
|
|
130
130
|
const handleScrollEnd = useCallback(
|
|
131
131
|
(event: ScrollEvent) => {
|
|
132
132
|
const x = event?.nativeEvent.contentOffset.x
|
|
133
|
-
const toPage = Math.
|
|
133
|
+
const toPage = Math.floor(((Math.round(x)) / Math.round(width)))
|
|
134
134
|
|
|
135
135
|
if (toPage !== page && toPage <= childArr.length - 1) {
|
|
136
136
|
setPage(toPage)
|
|
@@ -177,7 +177,7 @@ export const Pager = (pagerProps: PagerProps) => {
|
|
|
177
177
|
|
|
178
178
|
onUpdate(() => {
|
|
179
179
|
const x = width * page
|
|
180
|
-
if (scrollRef.current && x !== positionX
|
|
180
|
+
if (scrollRef.current && x !== positionX) {
|
|
181
181
|
scrollRef.current.scrollTo({
|
|
182
182
|
x,
|
|
183
183
|
animated: true,
|