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

Fix: Paginator positioning and alignment for full page tables isn't correct #2517

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aneeshsharma
Copy link
Contributor

Description

Pagination element for full page tables was positioned as fixed. Which meant if the width was set to 100%, it will take the width of the viewport and not the width of the parent table.

This leads to the positioning of the element being incorrect as well as alignment being off.

Solution is to make the pagination element position: sticky, that way width: 100% takes the width of the parent table and not the viewport.

This does mean that full page tables and embedded tables are now not different in terms of pagination.

Testing

I tested a few configurations of tables manually, as well as ran unit tests to make sure nothing is breaking with the change.

@aneeshsharma aneeshsharma requested a review from a team as a code owner November 14, 2023 05:16
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a3e3e12) 82.99% compared to head (ca34238) 82.99%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2517   +/-   ##
=======================================
  Coverage   82.99%   82.99%           
=======================================
  Files         925      925           
  Lines       20636    20636           
  Branches     3260     3260           
=======================================
  Hits        17127    17127           
  Misses       3389     3389           
  Partials      120      120           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Nov 14, 2023

Test Results

       4 files     316 suites   31m 30s ⏱️
1 131 tests 1 131 ✔️ 0 💤 0
1 141 runs  1 141 ✔️ 0 💤 0

Results for commit ca34238.

♻️ This comment has been updated with latest results.

@@ -262,7 +261,7 @@ import { CsvFileName } from '../download-file/service/file-download.service';
<div
class="pagination-controls"
*ngIf="this.pageable"
[style.position]="!this.showFloatingPaginator ? (this.isTableFullPage ? 'fixed' : 'sticky') : ''"
[style.position]="!this.showFloatingPaginator ? 'sticky' : ''"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aneeshsharma For a full-page table, after this change, does the paginator still stay at the same place when we scroll? Just want to make sure we are at parity with the existing use-case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, with this change the paginator would go at the bottom of the table in case of a full page table and an embedded table.

If the height of the table is not enough to accommodate all the rows, we get scrolling inside the table as was before with embedded table, while the pagination element is fixed w.r.t the table. If the table height is enough, the pagination element stays at the bottom of the table (without scrolling since all the rows are visible).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, then we can't make this change. We need to support existing behavior. Could you please come up with another solution to solve the alignment problem while ensuring the Paginator is not scrolled away?

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.

None yet

2 participants