@@ -646,13 +646,13 @@ export class FormControl extends AbstractControl {
646646 if ( ! this . dirty ) { this . markAsDirty ( ) ; }
647647 if ( ! this . touched ) { this . markAsTouched ( ) ; }
648648 this . setValue ( this . _pendingValue , { validate : true } ) ;
649- } else if ( ! this . touched ) {
650- if ( this . updateOn === "submit" && ! this . _pendingTouched ) {
651- this . _pendingTouched = true
652- } else {
653- this . markAsTouched ( ) ;
649+ } else if ( this . updateOn === "submit" ) {
650+ this . _pendingTouched = true ;
651+ this . _pendingDirty = true ;
652+ } else {
653+ if ( ! this . dirty ) { this . markAsDirty ( ) ; }
654+ if ( ! this . touched ) { this . markAsTouched ( ) ; }
654655 this . stateChanges . next ( ) ;
655- }
656656 }
657657 } ;
658658 /**
@@ -740,14 +740,16 @@ export class FormGroup extends AbstractControl {
740740 super ( coerceToValidator ( validatorOrOpts ) ,
741741 coerceToAsyncValidator ( asyncValidator , validatorOrOpts ) ) ;
742742 this . controls = controls ;
743+ this . submitted = false ;
743744 this . validatorOrOpts = validatorOrOpts ;
744- this . updateDOM = new Subject ( ) ;
745745 this . _initObservables ( ) ;
746746 this . _setUpdateStrategy ( validatorOrOpts ) ;
747747 this . _setUpControls ( ) ;
748748 this . updateValueAndValidity ( { onlySelf : true , emitEvent : false } ) ;
749- this . onSubmit = ( ) => {
750- this . _syncPendingControls ( ) ;
749+ this . handleSubmit = ( e ) => {
750+ e . preventDefault ( ) ;
751+ this . submitted = true ;
752+ if ( ! this . _syncPendingControls ( ) ) { this . updateValueAndValidity ( { validate : true } ) }
751753 }
752754 }
753755 /**
@@ -990,14 +992,16 @@ export class FormArray extends AbstractControl {
990992 coerceToValidator ( validatorOrOpts ) ,
991993 coerceToAsyncValidator ( asyncValidator , validatorOrOpts ) ) ;
992994 this . controls = controls ;
995+ this . submitted = false ;
993996 this . validatorOrOpts = validatorOrOpts ;
994- this . updateDOM = new Subject ( ) ;
995997 this . _initObservables ( ) ;
996998 this . _setUpdateStrategy ( validatorOrOpts ) ;
997999 this . _setUpControls ( ) ;
9981000 this . updateValueAndValidity ( { onlySelf : true , emitEvent : false } ) ;
999- this . onSubmit = ( ) => {
1000- this . _syncPendingControls ( ) ;
1001+ this . handleSubmit = ( e ) => {
1002+ e . preventDefault ( ) ;
1003+ this . submitted = true ;
1004+ if ( ! this . _syncPendingControls ( ) ) { this . updateValueAndValidity ( { validate : true } ) }
10011005 }
10021006 }
10031007 /**
0 commit comments