File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
angular/src/lib/components Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,12 @@ export class FormErrorMessageComponent {
9696
9797 errorMessage = computed ( ( ) => {
9898 const error = this . state ( ) . errorMap ?. onSubmit ;
99- if ( ! error ) return undefined ;
10099
101- // Handle string errors
102- return String ( error ) ;
100+ // We only care about errors thrown from the form submission, rather than validation errors
101+ if ( error && typeof error === "string" ) {
102+ return error ;
103+ }
104+
105+ return undefined ;
103106 } ) ;
104107}
Original file line number Diff line number Diff line change @@ -66,8 +66,9 @@ function ErrorMessage() {
6666 return (
6767 < form . Subscribe selector = { ( state ) => [ state . errorMap ] } >
6868 { ( [ errorMap ] ) => {
69- if ( errorMap ?. onSubmit ) {
70- return < div className = "fui-form__error" > { String ( errorMap . onSubmit ) } </ div > ;
69+ // We only care about errors thrown from the form submission, rather than validation errors
70+ if ( errorMap ?. onSubmit && typeof errorMap . onSubmit === "string" ) {
71+ return < div className = "fui-form__error" > { errorMap . onSubmit } </ div > ;
7172 }
7273
7374 return null ;
You can’t perform that action at this time.
0 commit comments