Skip to content

Material Stepper Icon: Custom SVG change #15631

@krezzsy

Description

@krezzsy

What is the expected behavior?

When mat-icon "svgIcon" property is updated for custom svg, the updated icon should be updated on the page.

What is the current behavior?

When mat-icon "svgIcon" property is updated via interpolation or renderer 2 the custom svg is not re-rendered. I'm able to see that "svgIcon" value of mat-icon changes in debug mode, but the svg isn't changed.

What are the steps to reproduce?

html:

<mat-step #addressCheckoutStep>
      <ng-template matStepLabel>
        <mat-icon svgIcon="{{addressSvgIcon}}">Address</mat-icon>
      </ng-template>
      <app-address></app-address>
</mat-step>

ts component:

onClick(){
    this.addressSvgIcon = 'another-svg-icon';
  }

Both svg icons are added to mat-icon-registry and displayable. The issue is related only to dynamic change of "svgIcon" property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: clarificationThe issue does not contain enough information for the team to determine if it is a real bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions