Skip to content

Commit 9521e6c

Browse files
committed
Comment edits
1 parent ccbb85e commit 9521e6c

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/cdk/stepper/stepper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

src/demo-app/stepper/stepper-demo.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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>

src/lib/stepper/stepper.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)