Skip to content

Commit a6ceb15

Browse files
committed
Remoeved the else condition
1 parent 0f7c8af commit a6ceb15

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<mat-checkbox
2121
[labelPosition]="'after'"
2222
[checked]="item.selected"
23-
[disabled]="bDisabled$ || bReadonly$"
2423
[required]="bRequired$"
2524
[attr.data-test-id]="testId + ':' + item.value"
2625
(change)="handleChangeMultiMode($event, item)"

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,9 @@ 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;
8281

83-
if (this.fieldControl) {
84-
if (this.bReadonly$) {
85-
this.fieldControl.disable({ emitEvent: false });
86-
} else {
87-
this.fieldControl.enable({ emitEvent: false });
88-
}
82+
if (this.bReadonly$) {
83+
this.fieldControl?.disable({ emitEvent: false });
8984
}
9085

9186
// multi case
@@ -95,6 +90,7 @@ export class CheckBoxComponent extends FieldBase implements OnInit, OnDestroy {
9590
this.selectionList = this.configProps$.selectionList;
9691
this.selectedvalues = this.configProps$.readonlyContextList;
9792
this.primaryField = this.configProps$.primaryField;
93+
this.bReadonly$ = this.configProps$.renderMode === 'ReadOnly' || this.displayMode$ === 'DISPLAY_ONLY' || this.configProps$.readOnly;
9894

9995
this.datasource = this.configProps$.datasource;
10096
this.selectionKey = this.configProps$.selectionKey;

0 commit comments

Comments
 (0)