File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ export class CdkStep {
6363 }
6464 private _disabled = false ;
6565
66- /** Whether the user has interacted with step or not. */
66+ /** Whether user has seen the expanded step content or not . */
6767 get interacted ( ) { return this . _interacted ; }
68- set interacted ( value : any ) {
69- this . _interacted = coerceBooleanProperty ( value ) ;
68+ set interacted ( value : boolean ) {
69+ this . _interacted = value ;
7070 }
7171 private _interacted = false ;
7272
Original file line number Diff line number Diff line change 11< h2 > Linear Vertical Stepper Demo</ h2 >
22< md-vertical-stepper >
33 < md-step >
4- < form [formGroup] ="nameFormGroup " novalidate >
4+ < form [formGroup] ="nameFormGroup ">
55 < ng-template mdStepLabel > Fill out your name</ ng-template >
66 < md-input-container >
77 < input mdInput placeholder ="First Name " formControlName ="firstNameFormCtrl " required >
@@ -18,7 +18,7 @@ <h2>Linear Vertical Stepper Demo</h2>
1818 </ md-step >
1919
2020 < md-step [disabled] ="!nameFormGroup.valid ">
21- < form [formGroup] ="phoneFormGroup " novalidate >
21+ < form [formGroup] ="phoneFormGroup ">
2222 < ng-template mdStepLabel >
2323 < div > Fill out your phone number</ div >
2424 </ ng-template >
Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ export class MdStep extends CdkStep {
5454 /** Custom error state matcher that additionally checks for validity of interacted form. */
5555 errorStateMatcher = ( control : FormControl , form : FormGroupDirective | NgForm ) => {
5656 let originalErrorState = this . _originalErrorStateMatcher ( control , form ) ;
57+
58+ /**
59+ * Custom error state checks for the validity of form that is not submitted or touched
60+ * since user can trigger a form change by calling for another step without directly
61+ * interacting with the current form.
62+ */
5763 let customErrorState = control . invalid && this . interacted ;
5864
5965 return originalErrorState || customErrorState ;
You can’t perform that action at this time.
0 commit comments