Skip to content

Commit 9982001

Browse files
committed
activePage
1 parent e79468d commit 9982001

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ const DynamicForm = React.forwardRef(
3232
onSumbitButtonPress();
3333
},
3434
nextPage: function () {
35-
if (currentIndex < formTemplate.data.length - 1) {
36-
scrollToIndex(currentIndex + 1);
37-
setCurrentIndex(currentIndex + 1);
35+
if (activePage < formTemplate.data.length - 1) {
36+
scrollToIndex(activePage + 1);
37+
// setCurrentIndex(currentIndex + 1);
3838
}
3939
}
4040
}));
@@ -151,6 +151,7 @@ const DynamicForm = React.forwardRef(
151151
const scrollPosition = event.nativeEvent.contentOffset.x; // Current scroll position
152152
const currentPage = Math.round(scrollPosition / deviceWidth); // Calculate active page
153153
setActivePage(currentPage); // Update active page
154+
console.log('FormBuilder:currentPage', currentPage);
154155
setCurrentPage && setCurrentPage(currentPage);
155156
};
156157

0 commit comments

Comments
 (0)