Skip to content

Commit 38ccebb

Browse files
committed
Fixed checkValidity()
1 parent abf739e commit 38ccebb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

force-app/main/default/lwc/checkboxGroup/checkboxGroup.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,10 @@ export default class CheckboxGroup extends LightningElement {
8383
checkValidity() {
8484
if(this._customValidityErrorMsg && !this.readOnly) {
8585
this._validity = false;
86+
} else if(this.required && !this.readOnly) {
87+
this._validity = this._checkboxes.reduce((acc, cb) => acc || cb.checked, false);
8688
} else {
8789
this._validity = true;
88-
89-
if(this.required && !this.readOnly) {
90-
this._validity &= this._checkboxes.reduce((acc, cb) => acc || cb.checked, false);
91-
}
9290
}
9391

9492
return this._validity;

0 commit comments

Comments
 (0)