@cocreate/validation 1.15.4 → 1.15.5
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/validations/required.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.15.5](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.15.4...v1.15.5) (2024-05-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* handling required validation of checkbox ([1a1b741](https://github.com/CoCreate-app/CoCreate-validation/commit/1a1b741645b7ec72371aef0d18e150e818dddb55))
|
|
7
|
+
|
|
1
8
|
## [1.15.4](https://github.com/CoCreate-app/CoCreate-validation/compare/v1.15.3...v1.15.4) (2024-04-29)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ export var required = async (elements) => {
|
|
|
6
6
|
let failedElements = [];
|
|
7
7
|
for (let element of elements) {
|
|
8
8
|
let value = await element.getValue();
|
|
9
|
-
if (value || value === 0 || value === false) {
|
|
9
|
+
if (value || value === 0 || (value === false && element.type !== 'checkbox')) {
|
|
10
10
|
element.setAttribute('validation', 'true');
|
|
11
11
|
} else {
|
|
12
12
|
element.setAttribute('validation', 'false');
|