-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect pages when content changes dynamically [iOS] #597
Comments
@yuri-lomashko-itechart the key workaround solved my problem. |
Same for me, the key workaround solved the problem, but without the workaround the issue still exist in 6.2.0. |
Same problem. It works by call onPageSelected={e => {
// add this
pageViewRef.current?.setPageWithoutAnimation(1);
const { position } = e.nativeEvent;
if (position === 2) {
setPages(pages.map(item => item + 1));
} else if (position === 0) {
setPages(pages.map(item => item - 1));
}
}}> |
I am experiencing similar issues neither of the NATIVE fixes @yuri-lomashko-itechart suggested worked for me. In the case of my app, I have a quiz that a user interacts with if new Content DIRECTLY PROCEEDS this quiz (i.e it is loaded in based on user interaction in the next slide) it breaks / blocks navigation and is the wrong (stale / previous content) I've narrowed it down in my case to https://github.com/callstack/react-native-pager-view/blob/master/ios/ReactNativePageView.m#L217-L233 I changed the else block here to the below code and it works for my use case but not sure this is a viable solution for the library but I'd like to commit it if it is or someone more versed on Obj-C cares to help me refactor
Working state react-native-pager-view-dynamic-content-working-state.movBroken State react-native-pager-view-dynamic-content-broken-state.movIn my host app I am also setting animated page view's prop of scrollEnabled to false until my request resolves.
|
Fixed in #898 |
Environment
Platform: iOS
react-native: 0.69.5
react-native-pager-view: 5.4.25
Description
I use the library for vertical scroll of fullscreen pages and receive few pages from BE. In cases when number of pages is changed I see the empty screens or not the whole list of pages. It's hard to say when it happens exactly, but in example bellow it can be reproduced in 80% cases. Also if to add some additional render then issue can be reproduced more frequent
Reproducible Demo
Video
Screen.Recording.2022-09-02.at.16.35.50.mov
Code sample
Workaround
Just add
key
toPagerView
likekey={pagesContent.toString()}
but it will produce re-render Pager itself and in some cases it's not possible to use this hackThe text was updated successfully, but these errors were encountered: