-
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
fix(stepper): block linear stepper for pending components #8646
fix(stepper): block linear stepper for pending components #8646
Conversation
const steps = this._steps.toArray(); | ||
|
||
steps[this._selectedIndex].interacted = true; | ||
|
||
if (this._linear && index >= 0) { | ||
return steps.slice(0, index).some(step => step.stepControl && step.stepControl.invalid); | ||
return steps.slice(0, index).some(step => | ||
step.stepControl && (step.stepControl.invalid || step.stepControl.pending) |
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.
can you add a unit test for a pending control?
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.
@mmalerba Sure. I've added unit tests and rebased the PR.
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.
Looks good, thanks!
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. |
In a linear stepper, going to the next step should require that no components of the step are in invalid or pending states (i.e. all components are valid or disabled). Pending components (i.e. components with async validators pending) should block the step.
Fixes #8645