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

Text Selection in Chrome behaves differently in Pdf.js demo and react-pdf

Open yuvalyellin opened this issue 1 week ago • 0 comments

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

  1. Load file in react-pdf
  2. Select a text
  3. Move mouse (while selecting) over a paragrph end white space
  4. 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)

yuvalyellin avatar Jun 24 '24 20:06 yuvalyellin