Skip to content

Commit

Permalink
fix: #17339 scrolling behaviour in table with footer and frozen rows (#…
Browse files Browse the repository at this point in the history
…17340)

Co-authored-by: Christian Tu <christian.tu@pv.at>
  • Loading branch information
honboubao and Christian Tu authored Jan 15, 2025
1 parent 4c0246e commit ce09dbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/primeng/src/table/style/tablestyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const theme = ({ dt }) => `
z-index: 2;
}
/* For PrimeNG */
.p-datatable-scrollable-table > .p-datatable-frozen-tbody:last-child {
.p-datatable-scrollable-table > .p-datatable-frozen-tbody + .p-datatable-frozen-tbody {
z-index: 1;
}
Expand Down Expand Up @@ -367,12 +367,16 @@ const theme = ({ dt }) => `
outline-offset: ${dt('datatable.row.focus.ring.offset')};
}
.p-datatable-tbody:has(+ .p-datatable-tfoot) > tr:last-child > td {
border-width: 0;
}
.p-datatable-tfoot > tr > td {
text-align: start;
padding: ${dt('datatable.footer.cell.padding')};
border-color: ${dt('datatable.footer.cell.border.color')};
border-style: solid;
border-width: 0 0 1px 0;
border-width: 1px 0 1px 0;
color: ${dt('datatable.footer.cell.color')};
background: ${dt('datatable.footer.cell.background')};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/primeng/src/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class TableService {
[style]="'height: calc(' + scrollerOptions.spacerStyle.height + ' - ' + scrollerOptions.rows.length * scrollerOptions.itemSize + 'px);'"
[ngClass]="cx('virtualScrollerSpacer')"
></tbody>
<tfoot role="rowgroup" *ngIf="footerGroupedTemplate || footerTemplate || _footerTemplate || _footerGroupedTemplate" #tfoot [ngClass]="cx('footer')">
<tfoot role="rowgroup" *ngIf="footerGroupedTemplate || footerTemplate || _footerTemplate || _footerGroupedTemplate" #tfoot [ngClass]="cx('footer')" [ngStyle]="sx('tfoot')">
<ng-container
*ngTemplateOutlet="
footerGroupedTemplate || footerTemplate || _footerTemplate || _footerGroupedTemplate;
Expand Down

0 comments on commit ce09dbe

Please sign in to comment.