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

自定义 disabled Button,Popover 无法打开 #38980

Closed
crazyair opened this issue Nov 25, 2022 · 11 comments
Closed

自定义 disabled Button,Popover 无法打开 #38980

crazyair opened this issue Nov 25, 2022 · 11 comments

Comments

@crazyair
Copy link
Member

Reproduction link

https://stackblitz.com/edit/react-kaqyfj?file=demo.tsx

Steps to reproduce

Hover me 2

What is expected?

显示 popover

What is actually happening?

没有显示 popover

Environment Info
antd 5.0.1
React latest
System mac
Browser chrome
@afc163
Copy link
Member

afc163 commented Nov 25, 2022

#38932 (comment)

@afc163 afc163 closed this as completed Nov 25, 2022
@afc163
Copy link
Member

afc163 commented Nov 25, 2022

#9581 (comment)

@crazyair
Copy link
Member Author

我修改了示例,为什么还不行

@afc163
Copy link
Member

afc163 commented Nov 25, 2022

const Button2 = (props: any) => {
  return <Button {...props} />;
};

+ (Button2 as any).__ANT_BUTTON = true;

@crazyair
Copy link
Member Author

Tooltip 里面能先获取 Component.children.__ANT_BUTTON 吗?

@afc163
Copy link
Member

afc163 commented Nov 25, 2022

封装是不可控的,这样查是不稳定的。

@crazyair
Copy link
Member Author

我发现还有个问题,Popover 会给 children props 注入 className:null; style:pointerEvents: 'none'?

@crazyair
Copy link
Member Author

虽然最终渲染的 button 有 class,但是为什么要把 props 的 className 改成 null

@afc163
Copy link
Member

afc163 commented Nov 25, 2022

#21404

@crazyair
Copy link
Member Author

<Popover content="content">
    <Input disabled />
</Popover>

input 是不是也需要 hover 显示,目前没有支持
image

@crazyair
Copy link
Member Author

crazyair commented Nov 25, 2022

能不能 Tooltip 加个属性,是否要包个 span,并且在 Tooltip 加个 FAQ

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

No branches or pull requests

2 participants