File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,9 @@ export const FormControlMixin = <T extends Constructor<LitElement>>(
222
222
this . _removeFormListeners ( ) ;
223
223
this . _form = this . _internals . form ;
224
224
if ( this . _form ) {
225
+ if ( this . _form . hasAttribute ( 'invalid-submit' ) ) {
226
+ this . pristine = false ;
227
+ }
225
228
this . _form . addEventListener ( 'submit' , this . _onFormSubmit ) ;
226
229
}
227
230
}
Original file line number Diff line number Diff line change @@ -44,9 +44,12 @@ export class UUIInputInFormExampleElement extends LitElement {
44
44
45
45
const isValid = this . _form . checkValidity ( ) ;
46
46
if ( ! isValid ) {
47
+ this . _form . setAttribute ( 'invalid-submit' , '' ) ;
47
48
return ;
48
49
}
49
50
51
+ this . _form . removeAttribute ( 'invalid-submit' ) ;
52
+
50
53
const formData = new FormData ( this . _form ) ;
51
54
52
55
for ( const value of formData . values ( ) ) {
You can’t perform that action at this time.
0 commit comments