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 in nested view with wrap={false} being compressed/squished after upgrading from v3.1.2 to v3.4.4 #2904

Open
renniehaylock opened this issue Oct 12, 2024 · 3 comments

Comments

@renniehaylock
Copy link

Describe the bug
When there's a nested view with wrap={false} with enough text to warrant moving the whole block onto the next page, the text overflows out of the page limits at the bottom, if there are multiple text nodes inside the view, those overlap each other. This was not a problem with v3.1.2, it also looks like it was not a problem in v2 (see Repl link below).

I tried my best to boil down the issue to the simplest example I could come up with (hence why I'm using paddingTop in the repl to force the view close to the bottom).

To Reproduce
React PDF repl with bug in v4.0.0: see here

Repl with bug in V3: see here

Working Repl using V2 (play with the padding to see that it works as expected, no overflows, no overlapping texts): see here, make sure to go to page 2 to see the text properly moved onto the next page

Expected behavior
Text inside the view with wrap={false} should be pushed onto the next page, not get pushed out of the bounds of page 1 and overlap over one another.

Screenshots
CleanShot 2024-10-11 at 20 40 49
CleanShot 2024-10-11 at 20 40 08

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: chrome and safari
  • React-pdf version: v4.0.0, v3.4.4
@gaithoben
Copy link

Same problem with v4
Screenshot 2024-10-18 at 2 57 30 AM

@renniehaylock
Copy link
Author

For what it's worth, one workaround is to add an empty view as the first item, before the element with wrap={false}. See repl here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@renniehaylock @gaithoben and others