bug(mat-tabs): Example of mat-tabs deletion is showing wrong index
Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
If we have three tabs and we navigate to the second tab or the 1st index and delete the first tab or the 0th index the selectedIndex doesnt update .
Reproduction
Steps to reproduce:
- Go to angular material website https://material.angular.io/components/tabs/examples, Under header 'Tab group with dynamically changing tabs'. Open Stackblitz.
- Remove the delete button html code from inside the mat-tab and place it outside the mat tab. Instead of passing index of mat-tab to remove function just pass 0 like (click)="removeTab(0)"
- Navigate to Tab1 or index =1 for mat tab and hit the delete button. The first mat tab gets deleted but the selectedIndex.value is still 1 in the screen.
- It only stops working when the currentIndex = 1 and we delete the 0th index Demo stackBlitz: https://components-issue-qwmzq3.stackblitz.io
Expected Behavior
The selectedIndex.value should show correct values
Actual Behavior
The selectedIndex.value shows incorrect value
Environment
- Angular:15.0.0
- CDK/Material:15.2.3
- Browser(s):Chrome
- Operating System (e.g. Windows, macOS, Ubuntu):Windows
Hey anyone working on this #26816issue ?
is this ticket still waits for the fix @parijat93sharma?
I couldn't reproduce it, this may have been fixed by #28256
Yes i am closing this issue. It has been fixed. Thanks
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.