react-native-pdf icon indicating copy to clipboard operation
react-native-pdf copied to clipboard

Cannot scroll when drag starts on document

Open CAWeissen opened this issue 6 years ago • 5 comments

What react-native version are you using? 0.57.8 What react-native-pdf version are you using? 5.0.11 What platform does your issue occur on? (android/ios/both) Both

Describe your issue as precisely as possible: 1) Steps to reproduce the issue or to explain in which case you get the issue Initially dragging within the PDF document does not allow scrolling. Dragging outside of the PDF document (but inside the <Pdf> component) allows scrolling of the PDF. If you drag outside of the PDF and the document is scrolling, you can click inside the PDF to continue scrolling.

Join a screenshot or video of the problem on the simulator or device? https://streamable.com/nbzxg

Show us the code you are using?

<Pdf styles={pdfStyles.pdf} source={source} />

const pdfStyles = StyleSheet.create({
  pdf: {
    flex:1,
    width:Dimensions.get('window').width,
  }
});```

CAWeissen avatar Feb 20 '19 20:02 CAWeissen

any solution for this issue?

trucnd avatar Mar 27 '19 06:03 trucnd

i'm having this issue in android too.

ace3 avatar Aug 28 '19 09:08 ace3

i'm having this issue in ios10 too

johnny09003525 avatar Aug 30 '19 03:08 johnny09003525

@trucnd Unfortunately not - I ended up using an alternative PDF package.

CAWeissen avatar Dec 04 '19 15:12 CAWeissen

You can add a "hack" View above your pdf to make it work

<View>
        <View
          style={{
            zIndex: 1,
            position: 'absolute',
            backgroundColor: 'transparent',
            height: // height of your pdf component
            width: // width of your pdf component
          }}
        />
        <Pdf
            ... 
         />
      </View>

martinfrouin avatar Mar 17 '22 13:03 martinfrouin