wojtekmaj / react-pdf

Display PDFs in your React app as easily as if they were images.
https://projects.wojtekmaj.pl/react-pdf
MIT License
8.97k stars 861 forks source link

Cannot drag text #1820

Open ed-sparkes opened 1 month ago

ed-sparkes commented 1 month ago

Before you start - checklist

Description

On a website if i select text then click again it allows me to drag the selection. In react-pdf the selection is cleared on the second click preventing this dragging behaviour. Dragging on a website adds the content to the DataTransfer object which means it can be access on drop etc.

Is there a way to support this with react-pdfs text layer

Many thanks, Ed

Steps to reproduce

Open a pdf with text, textLayer.css and annotationlayer.cs loaded select some text click again and try and drag the text

Expected behavior

text is added to data transfer object and dragged like normal text in a browser

Actual behavior

selection is cleared

Additional information

No response

Environment