wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.6k stars 557 forks source link

iOS - Pages flicker between first page and the page you were on after navigating back into the PDF from another screen #880

Open joffblack opened 2 weeks ago

joffblack commented 2 weeks ago

What react-native version are you using? 0.70.6

What react-native-pdf version are you using? 6.6.2

What platform does your issue occur on? (android/ios/both) iOS

Describe your issue as precisely as possible : I am viewing the PDF. We are using enablePaging. In my example let's say i am viewing page 5. In our app there are links overlayed on the PDF screen to navigate to a different screen in the app. If i navigate to a this different screen and then go 'back' to the PDF screen, it starts to flicker between page number 1 and page number 5 (the page i was on previously).

This is only happening on iOS. If i do the same on Android, after going 'back' into the PDF it stays on page 5 - which is my intended outcome.

Show us the code you are using?

<Pdf page={page} scale={currentScale} onScaleChanged={scale => setScale(scale)} enablePaging={true} source={source}
cache={false} onLoadComplete={(numberOfPages, filePath) => { setTotalPages(numberOfPages); }} onPageChanged={(page, numberOfPages) => { pointsFunction(page); setCurrentPage(page); setPage(page); }} onError={error => { console.log(error); }} onPressLink={uri => { Linking.openURL(uri); }} trustAllCerts={false} style={{...styles.pdf}} />

Any help would be appreciated!

https://github.com/user-attachments/assets/1376b1e1-fafa-47d9-91e1-00a496e4310f