ant-design-icons icon indicating copy to clipboard operation
ant-design-icons copied to clipboard

can't set onMouseEnter listener of Icons

Open tjx666 opened this issue 4 years ago • 6 comments

  • [ √] I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://github.com/tjx666/coo

Steps to reproduce

just see screenshot screenshot_2020-03-24_12-09-13

What is expected?

No error report

What is actually happening?

tsc compile error

Environment Info
antd 4.0.4
React 4.0.3
System win10pro1909
Browser electron8.1.1

tjx666 avatar Mar 24 '20 04:03 tjx666

Hello @tjx666. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. Appreciate it advance and we are looking forward to your contribution!

你好 @tjx666, 我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献!

giphy

ant-design-bot avatar Mar 24 '20 04:03 ant-design-bot

Temporary workaround screenshot_2020-03-24_12-26-23

tjx666 avatar Mar 24 '20 04:03 tjx666

@vagusX Is this related to https://github.com/ant-design/ant-design-icons/commit/fb390340eba8f44b1381eaf25afee1f31518c425#diff-917d780e4b5b0637839647e8ca200661R30 ?

afc163 avatar Mar 25 '20 08:03 afc163

@vagusX Is this related to fb39034#diff-917d780e4b5b0637839647e8ca200661R30 ?

According to v3-stable https://github.com/ant-design/ant-design/blob/3.x-stable/components/icon/index.tsx#L62 and v4 still use the same IconProps interface, so the conclusion is that we have never supported html element event listeners except onKeyUp and onClick.

So, @tjx666 you can wrap a to listen mouse event to get the workground.

What's more, @afc163 should we support all those event listeners?

vagusX avatar Mar 25 '20 15:03 vagusX

I have change my code logic and need not to listen those events, but I think those events are needed in some case.

tjx666 avatar Mar 26 '20 01:03 tjx666

We should, actually we support to pass all rest props into html element but our type definition does not.

afc163 avatar Mar 26 '20 02:03 afc163