I followed instructions in documentation written for my React-PDF version
I have checked if this bug is not already reported
I have checked if an issue is not listed in Known issues
If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
In PDF.js text selection works more smoothly than in react-pdf for my pdf (in Chrome)
I added a border to border to .textLayer span, and it seems like in pdf.js they pad text spans so they run into each other, making selection less jumpy, while in react-pdf when the mouse is over white spaces between elements selection behaves erraticaly.
The relevant code is in https://github.com/mozilla/pdf.js/blob/26ae50e4494aa57b31f305df759fb44ae8be4cd7/web/text_layer_builder.js , they call expandTextDivs onMouseDown. (when using enhanceTextSelection )
Can this be added to react-pdf?
Thanks,
Yuval
Steps to reproduce
Open a pdf in react-pdf in Chrome
Select a text hovering on white spaces between lines/ over edges
Expected behavior
Selection should run smoothly
Actual behavior
selection jumps to end/start of page / paragraph
Additional information
No response
Environment
Browser (if applicable): Chrome 103
React-PDF version: ^6.0.0-beta.3
React version: 18.2.0
Webpack version (if applicable): 5
The text was updated successfully, but these errors were encountered:
Adds an element behind text items that expands on mouse down. This especially improves text selection behavior on Firefox where elements with user-select: none prevent selection from being updated.
Closes#1034
Before you start - checklist
Description
In PDF.js text selection works more smoothly than in react-pdf for my pdf (in Chrome)
I added a border to border to .textLayer span, and it seems like in pdf.js they pad text spans so they run into each other, making selection less jumpy, while in react-pdf when the mouse is over white spaces between elements selection behaves erraticaly.
The relevant code is in https://github.com/mozilla/pdf.js/blob/26ae50e4494aa57b31f305df759fb44ae8be4cd7/web/text_layer_builder.js , they call expandTextDivs onMouseDown. (when using enhanceTextSelection )
Can this be added to react-pdf?
Thanks,
Yuval
Steps to reproduce
Open a pdf in react-pdf in Chrome
Select a text hovering on white spaces between lines/ over edges
Expected behavior
Selection should run smoothly
Actual behavior
selection jumps to end/start of page / paragraph
Additional information
No response
Environment
The text was updated successfully, but these errors were encountered: