Skip to content

fix(layout): don't leave a wrapping parent at the end of a page with only its fixed child - #3484

Open
zewish wants to merge 1 commit into
diegomura:masterfrom
zewish:master
Open

fix(layout): don't leave a wrapping parent at the end of a page with only its fixed child#3484
zewish wants to merge 1 commit into
diegomura:masterfrom
zewish:master

Conversation

@zewish

@zewish zewish commented Aug 12, 2026

Copy link
Copy Markdown

Summary

Found this while exporting a print menu, where a heading was alone at the bottom of one page and appeared again above its products on the next one. We use a patch-package patch until this is (hopefully 🤞) merged and released.

Minimal reproduction

The page is 300pt tall and the first block takes 255pt of it. That leaves 45pt, which is
enough for the 20pt header but not for the 40pt row after it.

<Document>
  <Page size={{ width: 200, height: 300 }}>
    <View style={{ height: 255 }} />
    <View>
      <View fixed style={{ height: 20 }} />
      <View wrap={false} style={{ height: 40 }} />
      <View wrap={false} style={{ height: 40 }} />
      <View wrap={false} style={{ height: 40 }} />
    </View>
  </Page>
</Document>

Old behavior:

  • Page 1 ends with the header and nothing under it
  • Page 2 starts with the same header, followed by all three rows

New behavior:

  • Page 1 ends after the first block, and the header and its rows stay together on page 2

@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2dcb963

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

This PR includes changesets to release 7 packages
Name Type
@react-pdf/layout Patch
@react-pdf/renderer Patch
@react-pdf/math Patch
@react-pdf/mermaid Patch
next-14 Patch
next-15 Patch
@react-pdf/vite-example 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

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