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

minPresenceAhead is not working as expected #2658

Open
kzmeyao opened this issue Feb 26, 2024 · 2 comments
Open

minPresenceAhead is not working as expected #2658

kzmeyao opened this issue Feb 26, 2024 · 2 comments

Comments

@kzmeyao
Copy link

kzmeyao commented Feb 26, 2024

Describe the bug
This is a follow-up to a previously closed issue: #2238.
It looks like the bug in the above issue is still happening with minPresenceAhead and fixed. What's also strange this time is that even when fixed is removed, the header is still not moving to the next page.

To Reproduce
Steps to reproduce the behavior including code snippet (if applies):

  1. Create a document with two components:
  • Some view that takes up most of the first page, e.g. <View style={{height: 600}}/>
  • A component that consists of a header, and a large block of text.
  1. Try and style the second component so that the header is fixed above each page as the large block of text, but make sure it does not appear by itself. So add both fixed and minPresenceAhead to the header.
  2. See that the minPresenceAhead rule is not obeyed. What's strange is that even when fixed is removed, minPresenceAhead doesn't seem like it's doing anything.

Repl link

Expected behavior
The header on the first page should not render by itself.

Screenshots
Expected:
224213733-db3f0076-17e8-4f2c-930b-6659508fd8f6

Actual:
224213720-70a980a3-f4cc-4dea-9b9a-ab7dce7a1a87

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • React-pdf version: 3.3.8
@fela98
Copy link

fela98 commented May 8, 2024

This is causing trouble for us when using table with a fixed header to repeat the table header across multiple pages.

The table header is included on the bottom of the page and minPresenceAhead does not take into account. Exactly as this problem also.

Currently we have to run on a pretty old version to make it work (@react-pdf/[email protected] and @react-pdf/[email protected]).

@fela98
Copy link

fela98 commented May 16, 2024

Here is our REPL link with which we're struggling to get it to work. Very similar.
REPL

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

2 participants