ngx-render-material-forms 1.3.5 → 1.3.6
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/esm2020/lib/components/textarea/textarea.component.mjs +8 -4
- package/esm2020/lib/components/textfield/textfield.component.mjs +6 -4
- package/fesm2015/ngx-render-material-forms.js +12 -6
- package/fesm2015/ngx-render-material-forms.mjs.map +1 -1
- package/fesm2020/ngx-render-material-forms.js +12 -6
- package/fesm2020/ngx-render-material-forms.mjs.map +1 -1
- package/package.json +1 -1
- /package/esm2020/{ngx-render-material-forms.js → ngx-render-material-formsmjs} +0 -0
|
@@ -513,10 +513,12 @@ class MaterialTextfieldComponent extends MaterialComponent {
|
|
|
513
513
|
this.controlHasError = this.control.hasError(msg.context.validator);
|
|
514
514
|
}
|
|
515
515
|
if (msg.context && this.controlHasError) {
|
|
516
|
-
if (this.instance.parent.submission.data
|
|
517
|
-
this.
|
|
516
|
+
if (this.instance && this.instance.parent && this.instance.parent.submission && this.instance.parent.submission.data) {
|
|
517
|
+
if (this.instance.parent.submission.data.submit) {
|
|
518
|
+
this.control.markAllAsTouched();
|
|
519
|
+
}
|
|
518
520
|
}
|
|
519
|
-
return this.instance.error.message;
|
|
521
|
+
return this.instance.error ? this.instance.error.message : '';
|
|
520
522
|
}
|
|
521
523
|
}
|
|
522
524
|
}
|
|
@@ -1060,10 +1062,14 @@ class MaterialTextareaComponent extends MaterialComponent {
|
|
|
1060
1062
|
this.instance.attachElement(this.textarea.nativeElement);
|
|
1061
1063
|
}
|
|
1062
1064
|
getErrorMessage() {
|
|
1063
|
-
if
|
|
1064
|
-
|
|
1065
|
+
// Check if instance and necessary properties exist
|
|
1066
|
+
if (this.instance && this.instance.parent && this.instance.parent.submission && this.instance.parent.submission.data) {
|
|
1067
|
+
if (this.instance.parent.submission.data.submit) {
|
|
1068
|
+
this.control.markAllAsTouched();
|
|
1069
|
+
}
|
|
1065
1070
|
}
|
|
1066
|
-
|
|
1071
|
+
// Return the error message if it exists
|
|
1072
|
+
return this.instance.error ? this.instance.error.message : '';
|
|
1067
1073
|
}
|
|
1068
1074
|
getValue() {
|
|
1069
1075
|
return isNil(this.control.value) ? '' : this.control.value;
|