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

Popconfirm + button 使用 disabled的问题 #5301

Closed
huyawei opened this issue Mar 14, 2017 · 10 comments
Closed

Popconfirm + button 使用 disabled的问题 #5301

huyawei opened this issue Mar 14, 2017 · 10 comments

Comments

@huyawei
Copy link

huyawei commented Mar 14, 2017

  • antd version:2.8.1
  • Browser and its version:Chrome 56.0.2924.87

Popconfirm + button 使用 disabled
button外层会产生一个span,点击button的时候 popconfirm会弹出,而且会对布局造成影响

希望disabled可以loading那样处理

@afc163
Copy link
Member

afc163 commented Mar 14, 2017

会对布局造成影响

Could you provide a re-producible demo to help us, by forking and editing this codepen: http://codepen.io/benjycui/pen/KgPZrE?editors=001

@afc163
Copy link
Member

afc163 commented Mar 14, 2017

Popconfirm 是 click 触发的,不会遇到 react-component/tooltip#18 的问题,不需要包裹 span,针对它去掉了。

Popover 可能还会遇到这个问题。

@afc163 afc163 closed this as completed Mar 14, 2017
@huyawei
Copy link
Author

huyawei commented Mar 14, 2017

.... 实际上 的确会产生一个span,使用 codepen.io 单独写一个能看到button外层被加了一个span,
这个span并不是我个人加的。
然后这个span很可能对 margin 这种属性造成影响。
目前只能用三目运算符做判断来处理

@afc163
Copy link
Member

afc163 commented Mar 14, 2017

给个 codepen 看看是如何影响 margin 的,我看看我能做什么兼容。

@huyawei
Copy link
Author

huyawei commented Mar 14, 2017

http://codepen.io/madaos/pen/GWvZRJ

loading 那个button,点击不会弹出 popconfirm
disabled 那个button,点击会弹出popconfirm,感觉应该处理为跟loading一样最好
另外 f12看下 disabled的button。会看到外面有一层span,这个demo虽然看起来效果
三个button都加了margin-left:10px,但是看span还是紧挨着上一个button

@afc163
Copy link
Member

afc163 commented Mar 14, 2017

  1. Bug #5254 not fully fixed, if Button's style comes from its classname, then the wrapping Tooltip is still broken. #5270 类似,06b17fd 的修复提升了 className,可以缓解类似的问题。
  2. 09fd82d 的修复之后,Popconfirm 也不会遇到这个问题。
  3. button disabled 如果不想弹出 Popconfirm ,建议业务自行处理就好。loading 是直接去除了鼠标事件,对于 disabled 不是很合适。

@huyawei
Copy link
Author

huyawei commented Mar 14, 2017

好吧,那我用三目运算符做判断吧

@afc163
Copy link
Member

afc163 commented Mar 14, 2017

这周发布后应该就能修复了,关注下。

@huyawei
Copy link
Author

huyawei commented Mar 14, 2017

嗯 非常感谢

afc163 referenced this issue Mar 19, 2017
@lock
Copy link

lock bot commented May 1, 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 1, 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

2 participants