- Issue created by @markusa
- πΊπΈUnited States markusa
Actually the first patch doesn't work, it doesn't empty the fields. I trying this
diff --git a/js/conditional_fields.js b/js/conditional_fields.js index 61e0bbd..b73d9be 100644 --- a/js/conditional_fields.js +++ b/js/conditional_fields.js @@ -70,6 +70,9 @@ if (e.effect) { if (e.value) { this.value = e.effect.value; + if (typeof e.effect.value === 'undefined') { + this.value = ''; + } } else if ($(this).data('conditionalFieldsSavedValue')) { this.value = $(this).data('conditionalFieldsSavedValue'); }
Probably a better/different way to solve this maybe module maintainers know.
- πΊπ¦Ukraine knyshuk.vova
The reason why we have this issue:
4.0.0-alpha5
$(this).val(e.effect.value);
val(undefined) in jQuery sets the value to an empty string (""), not string "undefined".4.0.0-alpha6
this.value = e.effect.value;
e.effect.value is undefined, the value property is set to string "undefined" - πΊπ¦Ukraine knyshuk.vova
Diff from previous patch:
- replaced if with nullish coalescing operator
- added some comments.