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

fix(cdk/stepper/stepper.ts) : Pressing stepper header and setting selectedIndex programmatically does not work correct #23454

Closed
wants to merge 1 commit into from

Conversation

sahilmore-git
Copy link

fix(cdk/stepper/stepper.ts) : Pressing stepper header and setting selectedIndex programmatically does not work correct

image
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.
---------->Please check the solution here<------------

Fixes #15627

…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
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 26, 2021
@sahilmore-git
Copy link
Author

@mmalerba thoughts?

@mmalerba
Copy link
Contributor

mmalerba commented Dec 1, 2021

I don't think this is the correct solution to the problem. We should instead make it so that clicking a step correctly updates the selected index in the stepper. That way when we programmatically change it later it will be detected as an actual change and update the UI

@andrewseguin andrewseguin removed the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 28, 2021
@andrewseguin
Copy link
Contributor

Closing due to inactivity after the last comment from mmalerba - feel free to reopen this PR if you'd like to try and land a fix for the issue

@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 May 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pressing stepper header and setting selectedIndex programmatically does not work correct
3 participants