react-pdf
react-pdf copied to clipboard
Text Selection in Chrome behaves differently in Pdf.js demo and react-pdf
Before you start - checklist
- [X] I followed instructions in documentation written for my React-PDF version
- [X] I have checked if this bug is not already reported
- [X] I have checked if an issue is not listed in Known issues
- [X] If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
Hi,
I am using this file: https://www.museumoffloridahistory.com/media/1489/short_history_of_florida.pdf
In pdf.js demo the text selection is smooth, but in react-pdf ( I used the create-react-app sample with this file ) , whenever I am over the white area (for example , white spaces between paragraphs) I am getting the old whole text selected bug .
Any ideas on what I can do to align to the behavior of pdf.js?
Thanks, Yuval
Steps to reproduce
- Load file in react-pdf
- Select a text
- Move mouse (while selecting) over a paragrph end white space
- Watch as text selection jumps around
Expected behavior
I would expect the same behavior as in pdf.js (waiting for the mouse to be over a text element to update the selectoin)
Actual behavior
some whole sections of the page are selected without any reason
Additional information
No response
Environment
- Browser (if applicable): Chrome 126.0.6478.62
- React-PDF version: 9
- React version: ^18.2.0",
- Bundler name and version (if applicable): CRA (I used the create react app sample)