wonday / react-native-pdf

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

Crash on tap/double tap with iOS 17 #772

Closed BologaMarius closed 11 months ago

BologaMarius commented 1 year ago

What react-native version are you using?

0.70.9

What react-native-pdf version are you using?

6.6.2 and 6.7.1

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

Noticed the issue just for devices/simulators running iOS 17.

Describe your issue as precisely as possible : 1) Steps to reproduce the issue or to explain in which case you get the issue On a simple tap or double tap inside the Pdf component while the pdf is rendered, the app crashes. Please find bellow the logs for the crash.

2) Interesting logs

#0           0x0000000117092fa1 in void PageLayout::ConvertTextRangesToStringRanges<std::__1::span<CFRange, 18446744073709551615ul>, std::__1::back_insert_iterator<std::__1::vector<CFRange, std::__1::allocator<CFRange> > > >(std::__1::span<CFRange, 18446744073709551615ul>&&, std::__1::back_insert_iterator<std::__1::vector<CFRange, std::__1::allocator<CFRange> > >&&) const ()

Join a screenshot or video of the problem on the simulator or device? n/a Show us the code you are using? n/a

sladek-jan commented 10 months ago

Hi @BologaMarius, our users are still facing the same issue on iOS 17. Are you not encountering it anymore since you had closed the issue? I would be curious to find out if you could fix it as it seems to be an internal bug in PDFKit?

BologaMarius commented 10 months ago

We are no longer see this issue. I patched the library to disable user interaction if the OS is 17 or higher. It should not affect any scroll, zoom or pinch actions on the pdf as per my testing.

_pdfView.documentView.userInteractionEnabled = NO;
sladek-jan commented 10 months ago

Ok, thank you! We'll try it out.