Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Text selection doesn't work as it does in pdf.js #1034

4 tasks done
yuvalyellin opened this issue Aug 1, 2022 · 1 comment
4 tasks done

Enhanced Text selection doesn't work as it does in pdf.js #1034

yuvalyellin opened this issue Aug 1, 2022 · 1 comment
enhancement New feature or request fresh


Copy link

Before you start - checklist

  • 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


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 , they call expandTextDivs onMouseDown. (when using enhanceTextSelection )
Can this be added to react-pdf?


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


  • Browser (if applicable): Chrome 103
  • React-PDF version: ^6.0.0-beta.3
  • React version: 18.2.0
  • Webpack version (if applicable): 5
@yuvalyellin yuvalyellin added the bug Something isn't working label Aug 1, 2022
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

@github-actions github-actions bot added the stale label Oct 31, 2022
@wojtekmaj wojtekmaj added enhancement New feature or request fresh and removed bug Something isn't working stale labels Nov 4, 2022
wojtekmaj added a commit that referenced this issue Nov 15, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
enhancement New feature or request fresh
None yet

No branches or pull requests

2 participants