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

Initial nested page break handling. And change to unwrappable content fallback behavior.. #2403

Closed
wants to merge 2 commits into from

Conversation

Scong
Copy link

@Scong Scong commented Sep 28, 2023

Adds loop to split nodes by nested page break using splitNode function.

If a node is found that has a breakable child, after performing standard pagination resolutions it will split children into two parts, putting the content after the page break in the second part, then rely on the relayout behavior to recompute as needed.

I have also changed the behavior for nodes marked as non-wrappable to fallback to wrapping if they do not fit on a page and could be wrapped.

I'm not sure if there will be other considerations here.

Looking for feedback.

Relating issues/enhancements might include:
#1037

#1676

@changeset-bot
Copy link

changeset-bot bot commented Sep 28, 2023

🦋 Changeset detected

Latest commit: f6bdaed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@react-pdf/layout Minor
@react-pdf/renderer Patch
@react-pdf/examples Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Scong
Copy link
Author

Scong commented Oct 3, 2023

Verifying the behavior here a bit more, I found it possible to get in an infinite loop on more complicated reports.

Looking into an issue with this approach when content is larger than a few pages and needs to split.

@Scong Scong closed this Oct 4, 2023
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

Successfully merging this pull request may close these issues.

1 participant