react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

minHeight causes overlapping with fixed elements

Open Mudbill opened this issue 10 months ago • 2 comments

Describe the bug

If you have a repeating element that wraps across multiple pages, while also using fixed elements that should appear on multiple pages, if you add a minHeight style to the repeating row, it appears to ignore the fixed space already consumed by the other elements. Interestingly, this doesn't happen if you use height instead.

To Reproduce

REPL Reproduction

(Also try to replace minHeight with height. A different but possibly related issue appears on page 2)

const lines = new Array(100).fill(null);

const PDF = () => (
  <Document>
    <Page>
      <View fixed>
        <Text>This is a header on each page</Text>
      </View>
      {lines.map((_, i) => (
        <View key={i} style={{ minHeight: 30 }} debug>
          <Text>Row {i + 1}</Text>
        </View>
      ))}
    </Page>
  </Document>
);

Expected behavior I expect the repeating rows to respect the space already occupied by the fixed elements.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • React-pdf version: 3.4.4

Mudbill avatar Apr 25 '24 22:04 Mudbill