Skip to content

Commit 763ac27

Browse files
committed
Updated the changes to only affect the checkbox component
1 parent 4e19b94 commit 763ac27

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/angular-sdk-components/src/lib/_components/field/check-box/check-box.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ export class CheckBoxComponent extends FieldBase implements OnInit, OnDestroy {
7878
this.showLabel$ = true;
7979
}
8080
this.variant = this.configProps$.variant;
81-
81+
if (this.bReadonly$) {
82+
this.fieldControl?.disable();
83+
}
84+
8285
// multi case
8386
this.selectionMode = this.configProps$.selectionMode;
8487
if (this.selectionMode === 'multi') {

packages/angular-sdk-components/src/lib/_components/field/field.base.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ export class FieldBase implements OnInit, OnDestroy {
111111
this.bReadonly$ = this.utils.getBooleanValue(readOnly);
112112

113113
// Enable or disable field control
114-
const shouldDisable = this.bDisabled$ || this.bReadonly$;
115-
this.fieldControl[shouldDisable ? 'disable' : 'enable']();
114+
this.fieldControl[this.bDisabled$ ? 'disable' : 'enable']();
116115

117116
// Display error message if validation message exists
118117
this.displayValidationMessage();

0 commit comments

Comments
 (0)