Skip to content

Commit f4af398

Browse files
committed
fix(material/table): fixed layout not working (#32494)
Fixes that the `fixedLayout` input wasn't doint anything in the Material table, because: 1. The `cdk-table-fixed-layout` styles were being overridden by the Material table's styling. 2. The style that the Material table was applying didn't have any styles associated with it. (cherry picked from commit 1fab386)
1 parent b1287cf commit f4af398

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/material/table/table.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ $fallbacks: m3-table.get-tokens();
3030
background-color: token-utils.slot(table-background-color, $fallbacks);
3131
}
3232

33+
// These styles already come from a similar class in the CDK,
34+
// but the `.mat-mdc-table` styles override them.
35+
.mat-table-fixed-layout {
36+
table-layout: fixed;
37+
}
38+
3339
.mdc-data-table__cell {
3440
box-sizing: border-box;
3541
overflow: hidden;

src/material/table/table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class MatRecycleRows {}
7070
styleUrl: 'table.css',
7171
host: {
7272
'class': 'mat-mdc-table mdc-data-table__table',
73-
'[class.mdc-table-fixed-layout]': 'fixedLayout',
73+
'[class.mat-table-fixed-layout]': 'fixedLayout',
7474
},
7575
providers: [
7676
{provide: CdkTable, useExisting: MatTable},

0 commit comments

Comments
 (0)