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

Table: Header and frozen columns hidden behind scrolled content if table has footer; footer not fixed #17339

Closed
4 tasks
honboubao opened this issue Jan 9, 2025 · 3 comments · Fixed by #17340
Closed
4 tasks
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@honboubao
Copy link
Contributor

honboubao commented Jan 9, 2025

Describe the bug

When a footer template is provided to the table while also having frozen rows configured breaks the scrolling behaviour.

When the table content is scrolled, it overlaps the header and frozen rows, when it should be rendered below the header and frozen rows with a lower z-index.

Also when a footer is provided and the table is scrollable, the footer scrolls with the content and is only visible when scrolled to the bottom. This differs from the behaviour in PrimeNG 17, where the footer is always visible like the header and is not part of the scrollable content.

Pull Request Link

#17340

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/stackblitz-starters-ixg5l2pw

Environment

Windows 10
Firefox 128.3.1esr

Angular version

19.0.5

PrimeNG version

v19

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Add table with scrollable and frozenValue, frozenbody template and footer template
  2. Observe that footer is not visible
  3. Scroll table content to bottom
  4. Observe that header and frozen rows are hidden behind scrollable content
  5. Observe that footer appears at end of scrollable content

Expected behavior

Header and frozen rows and footer should always be visible, no matter the scroll position of the scrollable content.

@honboubao honboubao added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 9, 2025
honboubao pushed a commit to honboubao/primeng that referenced this issue Jan 9, 2025
@mertsincan mertsincan added this to the 19.0.6 milestone Jan 15, 2025
@github-project-automation github-project-automation bot moved this to Review in PrimeNG Jan 15, 2025
@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 15, 2025
@github-project-automation github-project-automation bot moved this from Review to Done in PrimeNG Jan 15, 2025
@aimanicose
Copy link
Contributor

aimanicose commented Feb 20, 2025

Hello @honboubao ,

The behviour you are describing as bug (Scrolling to the bottom and finding the footer when the table is scrollable) is not a bug when using the footer template.
For a custom frozen footer the template "frozenfooter" should be used instead of simple "footer" as stated in the doc.

Your fix breaks the first behavior.

@honboubao
Copy link
Contributor Author

I considered it to be a bug since the behaviour you're describing (footer scrolls together with non-frozen content) deviates from what was implemented in version 17.

Here's 18/19
https://stackblitz.com/edit/stackblitz-starters-ixg5l2pw

and 17 for comparison
https://stackblitz.com/edit/stackblitz-starters-5ah8hsdi

In 17 the footer never scrolled with the content, whether you are using frozen rows or not.

But you're right, I haven't considered frozenfooter. Maybe it should be better described in the docs, as it's not mentioned in the samples at all. Also it seems to actually not do anything? frozenFooterTemplate gehts initallized but isn't put to use anywhere? /~https://github.com/primefaces/primeng/blob/19.0.6/packages/primeng/src/table/table.ts

@aimanicose
Copy link
Contributor

You are right, frozenfooter doesn't seem to do anything. It's declared and in the interface but nothing much more.

I think it would have been better if the fix actually implemented the template but oh well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants