@formio/js 5.1.0-dev.6060.19e3bfc → 5.1.0-dev.6061.f2b1042
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/dist/formio.form.js +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +1 -1
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/_classes/component/Component.js +5 -6
- package/lib/mjs/components/_classes/component/Component.js +5 -6
- package/package.json +1 -1
@@ -2551,12 +2551,11 @@ class Component extends Element_1.default {
|
|
2551
2551
|
}
|
2552
2552
|
get shouldAddDefaultValue() {
|
2553
2553
|
// It should add a default value if...
|
2554
|
-
// 1.)
|
2555
|
-
//
|
2556
|
-
//
|
2557
|
-
return
|
2558
|
-
|
2559
|
-
(this.emptyValue === '' || (typeof this.emptyValue === 'boolean')));
|
2554
|
+
// 1.) The component is pristine (user has not manually modified it). AND
|
2555
|
+
// 1.) There is a default value setting present OR
|
2556
|
+
// 2.) The noDefaults flag is not true AND the empty value is either an empty string or boolean
|
2557
|
+
return this.pristine && (this.hasDefaultValue ||
|
2558
|
+
(!this.options.noDefaults && (this.emptyValue === '' || (typeof this.emptyValue === 'boolean'))));
|
2560
2559
|
}
|
2561
2560
|
get defaultValue() {
|
2562
2561
|
let defaultValue = this.emptyValue;
|
@@ -2520,12 +2520,11 @@ export default class Component extends Element {
|
|
2520
2520
|
}
|
2521
2521
|
get shouldAddDefaultValue() {
|
2522
2522
|
// It should add a default value if...
|
2523
|
-
// 1.)
|
2524
|
-
//
|
2525
|
-
//
|
2526
|
-
return
|
2527
|
-
|
2528
|
-
(this.emptyValue === '' || (typeof this.emptyValue === 'boolean')));
|
2523
|
+
// 1.) The component is pristine (user has not manually modified it). AND
|
2524
|
+
// 1.) There is a default value setting present OR
|
2525
|
+
// 2.) The noDefaults flag is not true AND the empty value is either an empty string or boolean
|
2526
|
+
return this.pristine && (this.hasDefaultValue ||
|
2527
|
+
(!this.options.noDefaults && (this.emptyValue === '' || (typeof this.emptyValue === 'boolean'))));
|
2529
2528
|
}
|
2530
2529
|
get defaultValue() {
|
2531
2530
|
let defaultValue = this.emptyValue;
|