Skip to content

Commit 0f7c8af

Browse files
committed
Updated the checkbox component
1 parent 44a961e commit 0f7c8af

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ export class CheckBoxComponent extends FieldBase implements OnInit, OnDestroy {
7878
this.showLabel$ = true;
7979
}
8080
this.variant = this.configProps$.variant;
81+
this.bReadonly$ = this.configProps$.renderMode === 'ReadOnly' || this.displayMode$ === 'DISPLAY_ONLY' || this.configProps$.readOnly;
82+
83+
if (this.fieldControl) {
84+
if (this.bReadonly$) {
85+
this.fieldControl.disable({ emitEvent: false });
86+
} else {
87+
this.fieldControl.enable({ emitEvent: false });
88+
}
89+
}
8190

8291
// multi case
8392
this.selectionMode = this.configProps$.selectionMode;
@@ -86,7 +95,6 @@ export class CheckBoxComponent extends FieldBase implements OnInit, OnDestroy {
8695
this.selectionList = this.configProps$.selectionList;
8796
this.selectedvalues = this.configProps$.readonlyContextList;
8897
this.primaryField = this.configProps$.primaryField;
89-
this.bReadonly$ = this.configProps$.renderMode === 'ReadOnly' || this.displayMode$ === 'DISPLAY_ONLY' || this.configProps$.readOnly;
9098

9199
this.datasource = this.configProps$.datasource;
92100
this.selectionKey = this.configProps$.selectionKey;

0 commit comments

Comments
 (0)