wonday / react-native-pdf

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

[iOS] Panning after zooming snaps the view to the top left #99

Closed matiasbontempo closed 6 years ago

matiasbontempo commented 6 years ago

In iOS, when you zoom in a PDF and try to pan the view, it get's snapped to the top left. You can zoom out to unstuck it.

No issues detected in Android.

wonday commented 6 years ago

Yes , in iOS there is the problem. I can not fix this now, there is no IF of react-native to do it in iOS.

matiasbontempo commented 6 years ago

What do you mean by there is no IF of react-native?

wonday commented 6 years ago

I use Flatlist and the IF can only scroll to page left top

lucasbento commented 6 years ago

@wonday: what do you mean? is this an issue in JS or native side?

I'm experiencing the same with "react-native": "0.51.0" and "react-native-pdf": "^3.0.3".

wonday commented 6 years ago

RN js has no IF to control it.

lucasbento commented 6 years ago

@wonday: isn't the problem that _onScaleChanged calls scrollToOffset and makes the contentOffset loses it's reference from when it started zooming so it goes to 0?

lucasbento commented 6 years ago

Perhaps using something like https://github.com/GuoChen-WHU/react-native-pinch-zoom-view can solve this.

lucasbento commented 6 years ago

@wonday: I believe I managed to get zooming in and out working by using react-native-zoomable and a few tweaks: https://gist.github.com/lucasbento/a159137da1c21cb52f06e39929c57707

MoOx commented 6 years ago

In my case, I used a WebView on iOS.

matiasbontempo commented 6 years ago

I also used a WebView for iOS and it worked like a charm. I'm still using this package for Android.

adderly commented 6 years ago

Any updates to this?

wonday commented 6 years ago

untill v3.0.8 no updates about it.

matiasbontempo commented 6 years ago

@adderly the WebView alternative works fine. You can use it until this issue is solved.

adderly commented 6 years ago

@MatiasBontempo I did and it works greatly. I don't know how the caching works with webview ...

wonday commented 6 years ago

thought not perfect, v3.0.11 improve this zoom problem.

kr0000 commented 6 years ago

Zoom problem is active on iOS. Zoom doesn't work, only white space on left and right is bigger.

wonday commented 6 years ago

zoom still not smooth, I known it. other problem should be fixed. close it. if still has problem, please create a new one.