Skip to content

feat(stepper): add the ability to reset a stepper #8623

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

Merged
merged 1 commit into from
Jan 23, 2018

Conversation

crisbeto
Copy link
Member

Allows for the user to reset a stepper to its initial state by calling the reset method.

Relates to #7700.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 23, 2017
this.completed = false;

if (this.stepControl) {
this.stepControl.reset();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I'm open to having this reset only the dirty and touched states. I went with reset, because leaving behind the value didn't seem like a "true" reset.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like the most common use case to me. If we get lot of requests for reset all but the value we could create a new method: {reset,clear}{Status,State}

this.completed = false;

if (this.stepControl) {
this.stepControl.reset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like the most common use case to me. If we get lot of requests for reset all but the value we could create a new method: {reset,clear}{Status,State}

@mmalerba mmalerba added this to the 5.2 milestone Nov 27, 2017
@mmalerba
Copy link
Contributor

@crisbeto I set the milestone to 5.2 since this seems less severe than some of the other things we want to get in for 5.1. I'd be fine moving it to 5.1 if we have time after merging the other fixes

@crisbeto
Copy link
Member Author

I'm fine with leaving it for 5.2.

@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Nov 27, 2017
@crisbeto crisbeto added the target: minor This PR is targeted for the next minor release label Dec 6, 2017
@andrewseguin
Copy link
Contributor

See CI errors

Error at /home/travis/build/angular/material2/dist/packages/e2e-app/material-examples/typings/index.d.ts.StepperOverviewExample.html(1,1030): Property 'matHorizontalStepper' does not exist on type 'StepperOverviewExample'.

@crisbeto
Copy link
Member Author

Sorted out the error in the example.

Allows for the user to reset a stepper to its initial state by calling the `reset` method.

Relates to angular#7700.
@jelbourn jelbourn merged commit a6f9fc2 into angular:master Jan 23, 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 target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants