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

Tabs标签页 删除标签页后设置 nzSelectedIndex 失效 #3519

Closed
tinet-jutt opened this issue May 31, 2019 · 5 comments
Closed

Tabs标签页 删除标签页后设置 nzSelectedIndex 失效 #3519

tinet-jutt opened this issue May 31, 2019 · 5 comments
Assignees

Comments

@tinet-jutt
Copy link

Reproduction link

https://stackblitz.com/edit/angular-fjn1aj

Steps to reproduce

点击 Tab5 然后删除 Tab4

What is expected?

tabs切换至最后一个

What is actually happening?

未改变

Environment Info
ng-zorro-antd 7.4.1
Browser chrome 74.0.3729.131
@ng-zorro-bot
Copy link
Collaborator

Translation of this issue:


Tabs Tab Set nzSelectedIndex to expire after deleting the tab

Reproduction link

https://stackblitz.com/edit/angular-fjn1aj

Steps to reproduce

Click Tab5 and delete Tab4

What is expected?

Tabs switch to the last one

What is actually happening?

Unchanged

Environment Info
ng-zorro-antd 7.4.1
Browser chrome 74.0.3729.131

@lzdw
Copy link

lzdw commented Jun 13, 2019

看了你的 demo ,在 closeTab 方法中,你有对 index 重新赋值,造成了 tabs 切换至最后一个。@tomatoKnightJ

@tinet-jutt
Copy link
Author

看了你的 demo ,在 closeTab 方法中,你有对 index 重新赋值,造成了 tabs 切换至最后一个。@tomatoKnightJ

需求就是关闭当前tab切换至最后一个tab,这个没问题,问题点在于不能每次正确指向最后一个tab;

@lzdw
Copy link

lzdw commented Jun 18, 2019

看了你的 demo ,在 closeTab 方法中,你有对 index 重新赋值,造成了 tabs 切换至最后一个。@tomatoKnightJ

需求就是关闭当前tab切换至最后一个tab,这个没问题,问题点在于不能每次正确指向最后一个tab;

ok
tableClick 方法中不要对 index 重新赋值,在点击 tab 面板,会自动set nzSelectedIndex。
https://stackblitz.com/edit/angular-fjn1aj-r8v6vz

@hsuanxyz
Copy link
Member

Any other questions are welcome to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants