Skip to content

Commit 16acc22

Browse files
fix failed validation
1 parent f42d9e0 commit 16acc22

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/form/tp-form-field.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,19 @@ export class TPFormFieldElement extends HTMLElement {
167167
if ( true === suspenseIsValid ) {
168168
this.setAttribute( 'valid', 'yes' );
169169
this.removeAttribute( 'error' );
170+
171+
// Resolve the promise.
172+
resolve( true );
170173
} else {
171174
this.removeAttribute( 'valid' );
172175
this.setAttribute( 'error', error );
176+
177+
// Resolve the promise.
178+
resolve( false );
173179
}
174180

175181
// Dispatch a custom 'validation-suspense-success' event.
176182
this.dispatchEvent( new CustomEvent( 'validation-suspense-success' ) );
177-
178-
// Resolve the promise.
179-
resolve( true );
180183
} )
181184
.catch( (): void => {
182185
// There was an error.

0 commit comments

Comments
 (0)