Skip to content

Commit 46eb932

Browse files
authored
fix(cdk/table): _cellRole lint error (#28391)
1 parent c00c2db commit 46eb932

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/cdk/table/cell.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class CdkHeaderCell extends BaseCdkCell {
191191
export class CdkFooterCell extends BaseCdkCell {
192192
constructor(columnDef: CdkColumnDef, elementRef: ElementRef) {
193193
super(columnDef, elementRef);
194-
const role = columnDef._table?._cellRole;
194+
const role = columnDef._table?._getCellRole();
195195
if (role) {
196196
elementRef.nativeElement.setAttribute('role', role);
197197
}
@@ -209,7 +209,7 @@ export class CdkFooterCell extends BaseCdkCell {
209209
export class CdkCell extends BaseCdkCell {
210210
constructor(columnDef: CdkColumnDef, elementRef: ElementRef) {
211211
super(columnDef, elementRef);
212-
const role = columnDef._table?._cellRole;
212+
const role = columnDef._table?._getCellRole();
213213
if (role) {
214214
elementRef.nativeElement.setAttribute('role', role);
215215
}

src/cdk/table/table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ export class CdkTable<T> implements AfterContentChecked, CollectionViewer, OnDes
436436
private _hasRendered = false;
437437

438438
/** Aria role to apply to the table's cells based on the table's own role. */
439-
get _cellRole(): string | null {
439+
_getCellRole(): string | null {
440440
if (this._cellRoleInternal === undefined) {
441441
// Perform this lazily in case the table's role was updated by a directive after construction.
442442
const role = this._elementRef.nativeElement.getAttribute('role');

tools/public_api_guard/cdk/table.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ export class CdkTable<T> implements AfterContentChecked, CollectionViewer, OnDes
296296
addFooterRowDef(footerRowDef: CdkFooterRowDef): void;
297297
addHeaderRowDef(headerRowDef: CdkHeaderRowDef): void;
298298
addRowDef(rowDef: CdkRowDef<T>): void;
299-
get _cellRole(): string | null;
300299
// (undocumented)
301300
protected readonly _changeDetectorRef: ChangeDetectorRef;
302301
// (undocumented)
@@ -319,6 +318,7 @@ export class CdkTable<T> implements AfterContentChecked, CollectionViewer, OnDes
319318
set fixedLayout(value: boolean);
320319
// (undocumented)
321320
_footerRowOutlet: FooterRowOutlet;
321+
_getCellRole(): string | null;
322322
_getRenderedRows(rowOutlet: RowOutlet): HTMLElement[];
323323
_getRowDefs(data: T, dataIndex: number): CdkRowDef<T>[];
324324
// (undocumented)

0 commit comments

Comments
 (0)