Skip to content

Commit 070bf4d

Browse files
authored
fix: resolve NG0100 runtime error caused by initial readonly state (#2986)
Signed-off-by: Akshat Patel <[email protected]>
1 parent 25fff55 commit 070bf4d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export class PasswordInputLabelComponent extends BaseIconButton implements After
209209
@HostBinding("class.cds--password-input-wrapper") passwordInputWrapper = true;
210210
@HostBinding("class.cds--text-input-wrapper") textInputWrapper = true;
211211
@HostBinding("class.cds--text-input-wrapper--readonly") get isReadonly() {
212-
return this.wrapper?.nativeElement.querySelector("input")?.readOnly;
212+
return this.wrapper?.nativeElement.querySelector("input")?.readOnly ?? false;
213213
}
214214

215215
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class TextInputLabelComponent implements AfterViewInit {
139139
@HostBinding("class.cds--form-item") labelClass = true;
140140

141141
@HostBinding("class.cds--text-input-wrapper--readonly") get isReadonly() {
142-
return this.wrapper?.nativeElement.querySelector("input")?.readOnly;
142+
return this.wrapper?.nativeElement.querySelector("input")?.readOnly ?? false;
143143
}
144144

145145
/**

0 commit comments

Comments
 (0)