Skip to content

Commit

Permalink
refactor(material/expansion): remove incorrect inputs overrides (#2…
Browse files Browse the repository at this point in the history
…8310)

The bases classes of the CDK already define the input with transforms.
Technically the new `inputs` declarations override the full metadata,
loosing the transforms. This is currently a bug in the framework
where components relied on the behavior that transforms were
inherited independently. This commit fixes this and cleans up the
code. The inputs do not need to be re-declared.
  • Loading branch information
devversion authored Dec 20, 2023
1 parent b4bb466 commit 729dfc5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/material/expansion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {MatExpansionPanelHeader} from './expansion-panel-header';
@Directive({
selector: 'mat-accordion',
exportAs: 'matAccordion',
inputs: ['multi'],
providers: [
{
provide: MAT_ACCORDION,
Expand Down
2 changes: 0 additions & 2 deletions src/material/expansion/expansion-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ export const MAT_EXPANSION_PANEL_DEFAULT_OPTIONS =
templateUrl: 'expansion-panel.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
inputs: ['disabled', 'expanded'],
outputs: ['opened', 'closed', 'expandedChange'],
animations: [matExpansionAnimations.bodyExpansion],
providers: [
// Provide MatAccordion as undefined to prevent nested expansion panels from registering
Expand Down
4 changes: 2 additions & 2 deletions tools/public_api_guard/material/expansion.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class MatAccordion extends CdkAccordion implements MatAccordionBase, Afte
ngOnDestroy(): void;
togglePosition: MatAccordionTogglePosition;
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatAccordion, "mat-accordion", ["matAccordion"], { "multi": { "alias": "multi"; "required": false; }; "hideToggle": { "alias": "hideToggle"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "togglePosition": { "alias": "togglePosition"; "required": false; }; }, {}, ["_headers"], never, true, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<MatAccordion, "mat-accordion", ["matAccordion"], { "hideToggle": { "alias": "hideToggle"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "togglePosition": { "alias": "togglePosition"; "required": false; }; }, {}, ["_headers"], never, true, never>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatAccordion, never>;
}
Expand Down Expand Up @@ -128,7 +128,7 @@ export class MatExpansionPanel extends CdkAccordionItem implements AfterContentI
get togglePosition(): MatAccordionTogglePosition;
set togglePosition(value: MatAccordionTogglePosition);
// (undocumented)
static ɵcmp: i0.ɵɵComponentDeclaration<MatExpansionPanel, "mat-expansion-panel", ["matExpansionPanel"], { "disabled": { "alias": "disabled"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "hideToggle": { "alias": "hideToggle"; "required": false; }; "togglePosition": { "alias": "togglePosition"; "required": false; }; }, { "opened": "opened"; "closed": "closed"; "expandedChange": "expandedChange"; "afterExpand": "afterExpand"; "afterCollapse": "afterCollapse"; }, ["_lazyContent"], ["mat-expansion-panel-header", "*", "mat-action-row"], true, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MatExpansionPanel, "mat-expansion-panel", ["matExpansionPanel"], { "hideToggle": { "alias": "hideToggle"; "required": false; }; "togglePosition": { "alias": "togglePosition"; "required": false; }; }, { "afterExpand": "afterExpand"; "afterCollapse": "afterCollapse"; }, ["_lazyContent"], ["mat-expansion-panel-header", "*", "mat-action-row"], true, never>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanel, [{ optional: true; skipSelf: true; }, null, null, null, null, { optional: true; }, { optional: true; }]>;
}
Expand Down

0 comments on commit 729dfc5

Please sign in to comment.