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标签页切换时被隐藏的为什么不用display=none #6237

Closed
iceking112 opened this issue May 23, 2017 · 8 comments
Closed

tabs标签页切换时被隐藏的为什么不用display=none #6237

iceking112 opened this issue May 23, 2017 · 8 comments

Comments

@iceking112
Copy link

Version

2.10.2

Environment

window 10,chrome 58

Reproduction link

https://ant.design/components/tabs-cn/

Steps to reproduce

如果tabpanel中的元素存在 position: fixed 的情况,当切换标签页后该元素实际上并没有被隐藏,在当前tab页面仍然可以点击到。

What is expected?

切换标签页后,其他标签页彻底隐藏

What is actually happening?

其他标签页中的内容仍然能被点击

@afc163
Copy link
Member

afc163 commented May 23, 2017

tabs标签页切换时被隐藏的为什么不用display=none

因为有动画效果。

tabpanel中的元素存在 position: fixed

感觉不合理。position: fixed 的元素应该放到 Tabs 容器外。

@afc163 afc163 closed this as completed May 23, 2017
@iceking112
Copy link
Author

iceking112 commented May 23, 2017

@afc163
https://ant.design/components/tabs-cn/#components-tabs-demo-card
卡片式标签是没有动画的
关于position:_ fixed 的元素应该放到 Tabs 容器外
是因为在做后台管理系统,用tab来保存多页面展示的,每一个tab中存放的是整个route页面,很难限制里面一定不能用position: fixed

@afc163
Copy link
Member

afc163 commented May 23, 2017

type="card 会隐藏的。http://codepen.io/anon/pen/OmrajE?editors=0010

@iceking112
Copy link
Author

@afc163
http://codepen.io/mile112/pen/EmGGjm?editors=0010
我做了一点修改,把fix内容换成了button,添加了css cursor:'pointer',可以看到即使我进入别的tab,把鼠标移过去任何会出现小手的

@afc163 afc163 reopened this May 23, 2017
@afc163 afc163 closed this as completed May 23, 2017
@benjycui
Copy link
Contributor

@afc163 或者我们可以把不展示的 TabPane 设置为 visibility: hidden;?

@iceking112 测试下你的场景这样能否解决问题,可以的话来个 PR

@afc163
Copy link
Member

afc163 commented May 24, 2017

d6da305 已经足够了。

@iceking112
Copy link
Author

visibility: hidden;
point-event: none
都可以解决

@lock
Copy link

lock bot commented May 24, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants