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

Upgrading from @react-pdf/renderer 4.1.2 to 4.1.3 causes a variety of issues with lineHeight styles #2988

Open
EvHaus opened this issue Nov 30, 2024 · 0 comments

Comments

@EvHaus
Copy link

EvHaus commented Nov 30, 2024

Describe the bug

Very similar to #2369, I'm seeing issues with @react-pdf/renderer version 4.1.3 where adding a lineHeight style to the page causes all sorts of problems. Possibly caused by this commit or maybe this one?

The issue also exists in the latest 4.1.5 version.

To Reproduce

For example, if you add a lineHeight, any content rended via the render={() => 'foobar'} prop, won't render anymore. See REPL: https://react-pdf.org/repl?code=3187b0760ce02e00408a057025803c450298c0bc300500943807cf805030c00f0022230080b6198531165d400a02180e659a004f003619b006f09229180c00243123e002ca002e18011801d005600be07da74e5400a8614b00138b0026186e4c22460022792003bbda1ee0c6001e84ccc83780542a882e8199959d80801b8c8c80094307980a0b86800c474ecc11c6cf0a91151d0b04392c8800 (Removing the lineHeight style makes the text re-appear)

Additionally, a lineHeight value of 1.5 in 4.1.2 is half the size that it is in 4.1.3.

Screenshot 2024-11-29 at 9 22 40 PM

After some debugging, looks like rolling back @react-pdf/renderer to 4.1.2 isn't enough. I need to rollback to the following dependencies to make the problems go away:

  • @react-pdf/renderer: 4.1.2
  • @react-pdf/layout: 4.1.1
  • @react-pdf/reconciler: 1.1.1
  • @react-pdf/render: 4.0.1
  • @react-pdf/stylesheet: 5.0.1
  • @react-pdf/textkit: 5.0.0

I tried to figure out which specific package causes the issues, but it seems like it's a combo of several of them.

Expected behavior

A document with a lineHeight of 1.5 should have the same rendering between 4.1.2 and 4.1.3.

Screenshots

See above.

Desktop:

  • OS: MacOS
  • Browser: Rendering via Bun (server-side)
  • React-pdf version: 4.1.3
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

1 participant