gd-bs 6.5.1 → 6.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -665,13 +665,18 @@ export class FormControl implements IFormControl {
|
|
|
665
665
|
|
|
666
666
|
// Updates the control validation
|
|
667
667
|
updateValidation(elControl: Element, validation: IFormControlValidationResult) {
|
|
668
|
+
// See if this is a checkbox/switch
|
|
669
|
+
let isCheckbox = elControl.querySelectorAll(".form-check").length > 0;
|
|
670
|
+
|
|
668
671
|
// Get the form controls
|
|
669
|
-
let elFormControls = elControl.querySelectorAll(".form-control");
|
|
672
|
+
let elFormControls = isCheckbox ? [elControl] : elControl.querySelectorAll(".form-control");
|
|
670
673
|
elFormControls = elFormControls.length == 0 ? elControl.querySelectorAll(".form-select") : elFormControls;
|
|
674
|
+
|
|
675
|
+
// Parse the form controls
|
|
671
676
|
for (let i = 0; i < elFormControls.length; i++) {
|
|
672
677
|
// Ensure the control exists
|
|
673
678
|
let elFormControl = elFormControls[i] as HTMLElement;
|
|
674
|
-
if (
|
|
679
|
+
if (!isCheckbox) {
|
|
675
680
|
// Clear the invalid/valid classes
|
|
676
681
|
elFormControl.classList.remove("is-invalid");
|
|
677
682
|
elFormControl.classList.remove("is-valid");
|