-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(stepper): require users to visit non-optional steps #10048
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only a couple of nits.
src/cdk/stepper/stepper.ts
Outdated
@@ -349,7 +349,9 @@ export class CdkStepper implements OnDestroy { | |||
if (this._linear && index >= 0) { | |||
return steps.slice(0, index).some(step => { | |||
const control = step.stepControl; | |||
const isIncomplete = control ? (control.invalid || control.pending) : !step.completed; | |||
const isIncomplete = control ? | |||
(control.invalid || control.pending) || !step.interacted : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to have the parentheses around the !step.interacted
. I added the one around the control one so they're easier to distinguish inside the ternary.
expect(stepper.selectedIndex).toBe(0); | ||
|
||
stepper.selectedIndex = 1; | ||
fixture.detectChanges(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an assertion after this one as well?
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
fixes #8667