saasufy-components 8.6.0 → 8.7.0
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/collection-adder-form.js +11 -4
- package/package.json +1 -1
package/collection-adder-form.js
CHANGED
|
@@ -121,7 +121,9 @@ class CollectionAdderForm extends SocketConsumer {
|
|
|
121
121
|
})
|
|
122
122
|
);
|
|
123
123
|
|
|
124
|
-
this.reset
|
|
124
|
+
if (!this.hasAttribute('no-auto-reset')) {
|
|
125
|
+
this.reset();
|
|
126
|
+
}
|
|
125
127
|
|
|
126
128
|
outputValue = {
|
|
127
129
|
resource: insertedModelData
|
|
@@ -188,12 +190,17 @@ class CollectionAdderForm extends SocketConsumer {
|
|
|
188
190
|
for (let element of inputElements) {
|
|
189
191
|
if (element.nodeName === 'INPUT') {
|
|
190
192
|
if (element.type === 'checkbox' || element.type === 'radio') {
|
|
191
|
-
element.checked
|
|
192
|
-
|
|
193
|
+
let isChecked = element.hasAttribute('checked');
|
|
194
|
+
element.checked = isChecked || false;
|
|
195
|
+
} else if (element.type !== 'hidden') {
|
|
196
|
+
let currentValue = element.getAttribute('value');
|
|
197
|
+
element.value = currentValue || '';
|
|
198
|
+
} else if (element.type === 'hidden' && this.hasAttribute('auto-reset-hidden-inputs')) {
|
|
193
199
|
element.value = '';
|
|
194
200
|
}
|
|
195
201
|
} else if (element.nodeName === 'TEXTAREA') {
|
|
196
|
-
|
|
202
|
+
let currentValue = element.getAttribute('value');
|
|
203
|
+
element.value = currentValue || '';
|
|
197
204
|
} else if (element.nodeName === 'SELECT') {
|
|
198
205
|
element.selectedIndex = 0;
|
|
199
206
|
}
|