Skip to content

Commit 59d0515

Browse files
authored
Merge pull request #2617 from Akshat55/icon-ng-onchange
fix: check if cdsIcon value is truthy
2 parents 71468fe + b7ae918 commit 59d0515

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/icon/icon.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class IconDirective implements AfterViewInit, OnChanges {
126126
ngOnChanges({ cdsIcon }: SimpleChanges) {
127127
// We want to ignore first change to let the icon register
128128
// and add only after view has been initialized
129-
if (!cdsIcon.isFirstChange()) {
129+
if (cdsIcon && !cdsIcon.isFirstChange()) {
130130
this.renderIcon(this.cdsIcon);
131131
}
132132
}

src/input/label.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ import { TextInput } from "./input.directive";
9393
#wrapper>
9494
<svg
9595
*ngIf="!warn && invalid"
96-
ibmIcon="warning--filled"
96+
cdsIcon="warning--filled"
9797
size="16"
9898
class="cds--text-input__invalid-icon">
9999
</svg>
100100
<svg
101101
*ngIf="!invalid && warn"
102-
ibmIcon="warning--alt--filled"
102+
cdsIcon="warning--alt--filled"
103103
size="16"
104104
class="cds--text-input__invalid-icon cds--text-input__invalid-icon--warning">
105105
</svg>

src/input/text-input-label.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ import {
3434
#wrapper>
3535
<svg
3636
*ngIf="!warn && invalid"
37-
ibmIcon="warning--filled"
37+
cdsIcon="warning--filled"
3838
size="16"
3939
class="cds--text-input__invalid-icon">
4040
</svg>
4141
<svg
4242
*ngIf="!invalid && warn"
43-
ibmIcon="warning--alt--filled"
43+
cdsIcon="warning--alt--filled"
4444
size="16"
4545
class="cds--text-input__invalid-icon cds--text-input__invalid-icon--warning">
4646
</svg>

0 commit comments

Comments
 (0)