Skip to content

Commit b05b722

Browse files
fix: icon display when variant and category class are empty (#1975)
1 parent bf43c05 commit b05b722

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/ui/src/lib/icon/icon.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ export class IconComponent implements OnChanges {
117117
this.renderer.removeChild(this.el.nativeElement, isPreviousIcon);
118118
}
119119
const wrapper = this.renderer.createElement('span');
120-
[...this.iconVariantAndCategory, 'inline-flex', 'align-middle'].forEach(
121-
(classProp) => {
120+
[...this.iconVariantAndCategory, 'inline-flex', 'align-middle']
121+
.filter((classProp) => !!classProp)
122+
.forEach((classProp) => {
122123
this.renderer.addClass(wrapper, classProp);
123-
}
124-
);
124+
});
125125
this.renderer.appendChild(wrapper, i.node[0]);
126126
if (wrapper) {
127127
this.renderer.appendChild(this.el.nativeElement, wrapper);

0 commit comments

Comments
 (0)