@progressive-development/pd-contact 0.1.43 → 0.1.44
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 +1 -1
- package/src/PdContact.js +13 -2
package/package.json
CHANGED
package/src/PdContact.js
CHANGED
|
@@ -85,12 +85,23 @@
|
|
|
85
85
|
this._errorMap = new Map();
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
connectedCallback() {
|
|
89
|
+
super.connectedCallback();
|
|
90
|
+
// add validation event listener
|
|
91
|
+
this.addEventListener('validate-form', this._validateForm);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
disconnectedCallback() {
|
|
95
|
+
super.connectedCallback();
|
|
96
|
+
// add validation event listener
|
|
97
|
+
this.removeEventListener('validate-form', this._validateForm);
|
|
98
|
+
}
|
|
99
|
+
|
|
88
100
|
firstUpdated() {
|
|
89
101
|
this.addEventListener('key-pressed', e => {
|
|
90
102
|
this._errorMap.set(e.detail.name, '');
|
|
91
103
|
super.requestUpdate();
|
|
92
104
|
});
|
|
93
|
-
this.addEventListener('validate-form', this._validateForm);
|
|
94
105
|
}
|
|
95
106
|
|
|
96
107
|
render() {
|
|
@@ -406,7 +417,7 @@
|
|
|
406
417
|
);
|
|
407
418
|
|
|
408
419
|
// set prepared form, if no validation error occured
|
|
409
|
-
if (e.detail.errorMap.size === 0) {
|
|
420
|
+
if (e.detail.errorMap.size === 0 && e.detail.formData) {
|
|
410
421
|
e.detail.formData[this.id] = this._setFormData();
|
|
411
422
|
}
|
|
412
423
|
}
|