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

minHeight causes overlapping with fixed elements #2728

Open
Mudbill opened this issue Apr 25, 2024 · 0 comments
Open

minHeight causes overlapping with fixed elements #2728

Mudbill opened this issue Apr 25, 2024 · 0 comments

Comments

@Mudbill
Copy link

Mudbill commented Apr 25, 2024

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
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