Skip to content

Commit 4e19b94

Browse files
committed
Moving the change form the checkbox component file to the field base file
1 parent 4a620c2 commit 4e19b94

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ export class CheckBoxComponent extends FieldBase implements OnInit, OnDestroy {
7979
}
8080
this.variant = this.configProps$.variant;
8181

82-
if (this.bReadonly$) {
83-
this.fieldControl?.disable({ emitEvent: false });
84-
}
85-
8682
// multi case
8783
this.selectionMode = this.configProps$.selectionMode;
8884
if (this.selectionMode === 'multi') {

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

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

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

116117
// Display error message if validation message exists
117118
this.displayValidationMessage();

0 commit comments

Comments
 (0)