File tree 3 files changed +11
-5
lines changed
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ export class CdkStep {
63
63
}
64
64
private _disabled = false ;
65
65
66
- /** Whether the user has interacted with step or not. */
66
+ /** Whether user has seen the expanded step content or not . */
67
67
get interacted ( ) { return this . _interacted ; }
68
- set interacted ( value : any ) {
69
- this . _interacted = coerceBooleanProperty ( value ) ;
68
+ set interacted ( value : boolean ) {
69
+ this . _interacted = value ;
70
70
}
71
71
private _interacted = false ;
72
72
Original file line number Diff line number Diff line change 1
1
< h2 > Linear Vertical Stepper Demo</ h2 >
2
2
< md-vertical-stepper >
3
3
< md-step >
4
- < form [formGroup] ="nameFormGroup " novalidate >
4
+ < form [formGroup] ="nameFormGroup ">
5
5
< ng-template mdStepLabel > Fill out your name</ ng-template >
6
6
< md-input-container >
7
7
< input mdInput placeholder ="First Name " formControlName ="firstNameFormCtrl " required >
@@ -18,7 +18,7 @@ <h2>Linear Vertical Stepper Demo</h2>
18
18
</ md-step >
19
19
20
20
< md-step [disabled] ="!nameFormGroup.valid ">
21
- < form [formGroup] ="phoneFormGroup " novalidate >
21
+ < form [formGroup] ="phoneFormGroup ">
22
22
< ng-template mdStepLabel >
23
23
< div > Fill out your phone number</ div >
24
24
</ ng-template >
Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ export class MdStep extends CdkStep {
54
54
/** Custom error state matcher that additionally checks for validity of interacted form. */
55
55
errorStateMatcher = ( control : FormControl , form : FormGroupDirective | NgForm ) => {
56
56
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
+ */
57
63
let customErrorState = control . invalid && this . interacted ;
58
64
59
65
return originalErrorState || customErrorState ;
You can’t perform that action at this time.
0 commit comments