NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.85k stars 3.91k forks source link

Automatic tab navigation doesn't work when using url fragments #4546

Open Xambey opened 4 years ago

Xambey commented 4 years ago

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-start-sx8xyz

Steps to reproduce

Change URL in the viewport on https://ng-zorro-antd-start-sx8xyz.stackblitz.io/#endpoints (endpoints = hash tag of the second tab) and refresh view (like page)

What is expected?

Automatic tab navigation when I go through the url with the fragment(ex. #endpoints i must go to the second tab) defined in the tab, like with the parameters

What is actually happening?

Opens the first (groups) tab

Environment Info
ng-zorro-antd 8.5.2
Browser Chrome Version 77.0.3865.120 (Official Build) (64-bit)
Xambey commented 4 years ago

Maybe this isn't a bug, but I would like such functionality

wenqi73 commented 4 years ago

https://github.com/angular/angular/issues/27450

Xambey commented 4 years ago

@wenqi73 you can make your own directive, this is not such a problem or get around this via css https://stackoverflow.com/questions/41393427/angular-2-exact-routerlinkactive-including-fragments