Skip to content

Commit

Permalink
fix(icon): clear svg when changing to icon font (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and GitHub Enterprise committed Sep 16, 2021
1 parent b298c02 commit e322c61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion projects/ng-aquila/src/icon/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ export class NxIconComponent implements OnChanges {
// here we fall back to the icon class so we look at the `font` input
// or take the default font
this._updateFontIconClasses();
this._clearSvgElement();
} else {
if (icon instanceof NxSvgIcon) {
// add content
icon.getContent().pipe(take(1)).subscribe((content: SVGElement | undefined) => {
icon.getContent().pipe(take(1)).subscribe((content?: SVGElement) => {
if (!content) {
return;
}
Expand All @@ -115,6 +116,7 @@ export class NxIconComponent implements OnChanges {
} else {
// here we have to look at the alias as well that could come from the registry
this._updateFontIconClassesFromOverride(icon.alias, icon.font);
this._clearSvgElement();
}
}
}
Expand Down

0 comments on commit e322c61

Please sign in to comment.