Skip to content

fix(material-experimental/mdc-list): don't access class before initialization #25049

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

Merged
merged 1 commit into from
Jun 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions src/material-experimental/mdc-list/list-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,37 @@ import {
MatListItemAvatar,
} from './list-item-sections';

@Directive({
host: {
'[class.mat-mdc-list-non-interactive]': '_isNonInteractive',
'[attr.aria-disabled]': 'disabled',
},
})
/** @docs-private */
export abstract class MatListBase {
_isNonInteractive: boolean = true;

/** Whether ripples for all list items is disabled. */
@Input()
get disableRipple(): boolean {
return this._disableRipple;
}
set disableRipple(value: BooleanInput) {
this._disableRipple = coerceBooleanProperty(value);
}
private _disableRipple: boolean = false;

/** Whether all list items are disabled. */
@Input()
get disabled(): boolean {
return this._disabled;
}
set disabled(value: BooleanInput) {
this._disabled = coerceBooleanProperty(value);
}
private _disabled = false;
}

@Directive({
host: {
'[class.mdc-list-item--disabled]': 'disabled',
Expand Down Expand Up @@ -274,37 +305,6 @@ export abstract class MatListItemBase implements AfterViewInit, OnDestroy, Rippl
}
}

@Directive({
host: {
'[class.mat-mdc-list-non-interactive]': '_isNonInteractive',
'[attr.aria-disabled]': 'disabled',
},
})
/** @docs-private */
export abstract class MatListBase {
_isNonInteractive: boolean = true;

/** Whether ripples for all list items is disabled. */
@Input()
get disableRipple(): boolean {
return this._disableRipple;
}
set disableRipple(value: BooleanInput) {
this._disableRipple = coerceBooleanProperty(value);
}
private _disableRipple: boolean = false;

/** Whether all list items are disabled. */
@Input()
get disabled(): boolean {
return this._disabled;
}
set disabled(value: BooleanInput) {
this._disabled = coerceBooleanProperty(value);
}
private _disabled = false;
}

/**
* Sanity checks the configuration of the list item with respect to the amount
* of lines, whether there is a title, or if there is unscoped text content.
Expand Down