Skip to content
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

Merged
merged 2 commits into from
Feb 26, 2018

Conversation

mmalerba
Copy link
Contributor

@mmalerba mmalerba commented Feb 20, 2018

fixes #8667

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 20, 2018
Copy link
Member

@crisbeto crisbeto left a 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.

@@ -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 :
Copy link
Member

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();
Copy link
Member

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?

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Feb 20, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linear stepper: already valid steps can be skipped without visit
4 participants