fix(module:tabs): update active router tab after tabs changed - #7649
Conversation
|
This preview will be available after the AzureCI is passed. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7649 +/- ##
==========================================
+ Coverage 91.94% 91.95% +0.01%
==========================================
Files 559 559
Lines 19773 19774 +1
Branches 3050 3050
==========================================
+ Hits 18180 18184 +4
+ Misses 1267 1262 -5
- Partials 326 328 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3c8cc06 to
c9d044e
Compare
c9d044e to
04467af
Compare
04467af to
05d7fd2
Compare
|
I have update the pr Please take a look when you have time, let me know if there any problem in the code, i will try fix it as soon a i can |
|
Any further progress on this? It's been nearly two years, and we're still seeing the Menu default to the first page on page refresh. |
Laffery
left a comment
There was a problem hiding this comment.
Please rebase from master
05d7fd2 to
831cd2a
Compare
Updated |
831cd2a to
dca1082
Compare
|
Here is a demo video may better explain the idea Screen.Recording.2025-03-26.at.14.17.36.mov
|
| </a> | ||
| Four. | ||
| </nz-tab> | ||
| <nz-tab *ngFor="let tab of dynamicTabs"> |
| tick(); | ||
| fixture.detectChanges(); | ||
|
|
||
| // tabs = fixture.debugElement.query(By.directive(NzTabSetComponent)); |
|
|
||
| @Component({ | ||
| template: ` <nz-tabset nzLinkRouter [(nzSelectedIndex)]="selectedIdx" [nzLinkExact]="false"> | ||
| <nz-tab *ngFor="let tab of tabs"> |
dca1082 to
51b18c2
Compare
|
This PR introduced a bug that is also confirmed by other users. Check it here: #9083 |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Tabs with Router always select the first tab after a refresh
Issue Number: #4773
What is the new behavior?
Tabs with Router will select the tab match the route after a refresh
Does this PR introduce a breaking change?
Other information
I have added an
ADDbutton to the demo of link router tab which will add a new tab after click; you can try refresh demo page with query paramstab=1(the full path should be/components/tabs/en?tab=1), and click theADDbutton on link router demo, the active tab should switch to the newly added tab with titleNewTab1