-
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(cdk-stepper): coercing selectedIndex value to a Number #14817
fix(cdk-stepper): coercing selectedIndex value to a Number #14817
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.
The code looks good, but can you add a unit test for it?
Hi @s2-abdo! This PR has merge conflicts due to recent upstream merges. |
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
b60e751
to
0981b66
Compare
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
@s2-abdo looks like that rebase wasn't quite right |
Removing merge ready label as the PR needs to be rebased back to master and then the cla can be checked again. |
@s2-abdo I attempted to fix this, I think it looks like how you had it: master...mmalerba:pr/14817 I can push to your PR branch if you like |
@mmalerba sure, be free to do that. 👍 |
322c6d6
to
eb01fd6
Compare
CLAs look good, thanks! |
eb01fd6
to
0777887
Compare
* fix(cdk-stepper): coercing selectedIndex value to a Number * test(cdk-stepper): preselected value should be number
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. |
Expected Behavior📗
The label of the stepper should show the current step index
Actual Behavior 📕
The number shown is wrong. It's adding a '1' for some reason
Description
Make a simple implementation of a Multi-Stepper and found out that the label information in the mobile view is not showing properly whenever 'selectedIndex' is used. It is handling the value as a string, therefore the result is 11/3 for example instead of 2/3.
'1' + 1 will be handled as a string concatenation.
Steps to Reproduce 🔬
Code
<mat-horizontal-stepper [linear]="true" selectedIndex="1"> <mat-step label="One"></mat-step> <mat-step label="Two"></mat-step> <mat-step label="Three"></mat-step> </mat-horizontal-stepper>
Proposed solution
Add a coercing to Number type for the selectedIndex value in its setter.