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

Text layer container isn't scrolling horizontally along with canvas #1118

Closed
4 tasks done
gladkovayuliya opened this issue Nov 1, 2022 · 5 comments
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@gladkovayuliya
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

Description

In my app i have pdf previewer with scaling feature. To do that, i set the width of page to some value. At some point page doesn't fit in and the horizontal scroll shows up. The page looks normal, but the text layer does not, it's not scrolling with canvas, it stays pinned to the left.
There are couple of solutions i came up with: wrap Document in div with desired width or set overflow of text layer to inherit instead of hidden.

Steps to reproduce

  1. Set page width bigger than width of document itself
  2. Select all text on the page
  3. Selection ends at some point, not at the real end of the page (horizontally)

Expected behavior

Selection is scrolling along with canvas

Actual behavior

Selection doesn't reach the end of the page

Additional information

Sandbox example to illustrate the issue: https://codesandbox.io/s/react-pdf-textlayer-align-gzuncr?file=/src/index.jsx

Environment

  • React-PDF version: "6.0.0-beta.4"
  • React version: "18.0.0"
@gladkovayuliya gladkovayuliya added the bug Something isn't working label Nov 1, 2022
@rabbanirizwan
Copy link

rabbanirizwan commented Nov 2, 2022

6z8o50
I have tried to reproduce this issue but I think it is working fine @gladkovayuliya

@wojtekmaj wojtekmaj added question Further information is requested and removed bug Something isn't working labels Nov 4, 2022
@wojtekmaj
Copy link
Owner

Maybe it happens on some specific browser?

@gladkovayuliya
Copy link
Author

@rabbanirizwan, but in your gif you are selecting only half of the text and cannot select another, how is it normal?

@wojtekmaj wojtekmaj added bug Something isn't working and removed question Further information is requested labels Nov 4, 2022
@wojtekmaj
Copy link
Owner

My bad. I now understand what's up :) Fixed.

@gladkovayuliya
Copy link
Author

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants