[Tabs] tab is not changed when selectedindex changes
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Tab corresponding to the index should be displayed.
What is the current behavior?
Previously selected tab is displayed, tabGroup selectedIndex is not updated.
What are the steps to reproduce?
This bug can also be found in the documentation/demos. Material Demo In the demo "Tag group with dynamically changing tabs" when checking the "Select tab after adding", the tab is not focused when adding a tab. In custom code the tab is also not focused when updating the selectedIndex.
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
- Angular: 6.0.6
- Angular Material: 6.3.2
- OS: Windows
- Browsers: Chrome, FireFox, Opera, IE Edge
Is there anything else we should know?
+1
I'm too facing similar issue for MatStepper module. The selectedIndex property is not updated first click event but always on second one. It's similar to what @robertmesserle explained here https://github.com/angular/material2/issues/687 but for stepper module.
The ability to select a tab after adding it appears to have been broken by #9132.
+1 - reverting fixed for me.
This is also a serious bug for our business. Please fix the functionality and the example on your page.
@Auricopter A fix is now pending. Working on getting that in as soon as possible.
@DevVersion Thank you. It works now. However I need to add a setTimeout() since the code example on your page doesn't wait for the Tab Creation before changing the selectedIndex. Is there a callback-function or life cycle hook for the Tab Creation?
The fix is not merged and published yet. As soon as it will be part of a future Material release, you wouldn't need the setTimeout at all. Everything happens in the same change detection run
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.