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

Select tagRender的上下问参数onClose有歧义 #48697

Closed
hans000 opened this issue Apr 29, 2024 · 4 comments
Closed

Select tagRender的上下问参数onClose有歧义 #48697

hans000 opened this issue Apr 29, 2024 · 4 comments

Comments

@hans000
Copy link

hans000 commented Apr 29, 2024

What problem does this feature solve?

onXXX通常都是事件处理函数,实际使用应该却是action handler的效果,所以名字应该改一下叫close,我理解里面的传参也是不需要的,我在外面都有event了,还差那一句调用吗
image

What does the proposed API look like?

@Wxh16144
Copy link
Member

Wxh16144 commented Apr 29, 2024

你这个截图指的是:https://github.com/react-component/select/blob/424bcfd0614f9d8e013a983a2daf80fa46c906ca/src/Selector/MultipleSelector.tsx#L145 这里的逻辑吧。(你的截图不规范,还得单独去找,很麻烦

我看了一眼代码确实是一个 action 操作,但是你说的改名这会变成一个 breakchange,不太可取。

(源码也是将 onClose 直接传递给某个操作 onClick 回调函数

最后贴一个 antd 的文档: https://ant.design/components/select-cn#select-demo-custom-tag-render

image

@hans000
Copy link
Author

hans000 commented Apr 30, 2024

我主要想问一下作者的看法,应该可以先注上deprecated 写上原因的,另开一个字段

@Wxh16144
Copy link
Member

我主要想问一下作者的看法,应该可以先注上deprecated 写上原因的,另开一个字段

嗯嗯,可以等核心成员今天周会的时候评论一下~

@MadCcc
Copy link
Member

MadCcc commented May 8, 2024

onClose 指的是点击关闭按钮的这个事件,Modal 也是一样的,没有更名必要

@MadCcc MadCcc closed this as completed May 8, 2024
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

3 participants