-
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
Pressing stepper header and setting selectedIndex programmatically does not work correct #15627
Comments
Confirmed that this is a real bug. Updated StackBlitz for v12: To summarize, after clicking a step, setting the |
Is this issue up for grabs? @jelbourn |
fix(cdk/stepper/stepper.ts) : Pressing stepper header and setting selectedIndex programmatically does not work correct
Fixes #15627 |
thoughts @jelbourn @josephperrott @andrewseguin @FritzHerbers ?? |
…ectedIndex programmatically does not work correct Basically what happens here is that if we choose 3rd step from the tabs and again go and click on Button(selected index=0) it wont work because the value of selected index is already 0 hence it won't change the tabs too. So what I have done is simply reset the steps if we get same index after clicking the button. What this will do is it will allow us to re-select all the tabs again without any issue. Fixes angular#15627
Hey @jelbourn, im not sure if its really bug, i mean, i think that selectedIndex should be the same for the parent and the checkbox either. In this case, when i select any step the value wasnt update on parent(selectedIndex parent = 0, selectedIndex checkbox = 3), so when i try to select the step 0 the view understand that dosent was any change. This scenarious can be happen with any step depending the default value from selectedIndex from parent.
Perhaps to facilitate this use, the ideal would be to implement a selectedIndexChange so that the selectedIndex is a twoBinding |
@andrewseguin worth taking a quick look to see if this should be closed (and the behavior should be similar to tabs) |
Hi everyone, I was looking for some good first issues and found this one. |
adds two-way binding for selectedIndex, previously stepper had selectionChange which include selectedIndex & other properties in it fixes angular#15627
adds two-way binding for selectedIndex, previously stepper had selectionChange which include selectedIndex & other properties in it fixes angular#15627
* fix(material/stepper): two-way binding for selectedIndex adds two-way binding for selectedIndex, previously stepper had selectionChange which include selectedIndex & other properties in it fixes #15627 * fixup! fix(material/stepper): two-way binding for selectedIndex
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. |
What is the expected behavior?
Pressing the header and setting selectedIndex programmatically should both be possible.
What is the current behavior?
Pressing the header and setting selectedIndex programmatically does not work correct.
What are the steps to reproduce?
https://stackblitz.com/edit/angular-1ganxn?file=app%2Fstepper-overview-example.html
Reproduction steps within the Stackblitz example.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
See stackblitz dependencies.
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: