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

feat: support multiple target on useClickAway #563

Merged
merged 3 commits into from
Aug 7, 2020

Conversation

Fadingvision
Copy link
Contributor

No description provided.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Collaborator

@brickspert brickspert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,can you add demo and doc for this feature? thank you very much.

@Fadingvision
Copy link
Contributor Author

@brickspert Updated

* title: Custom multiple DOM target
* desc: Support pass multiple DOM elements, or functions which returns the DOM element.
*
* title.zh-CN: 支持多个DOM对象
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中英文之间加空格

* desc: Support pass multiple DOM elements, or functions which returns the DOM element.
*
* title.zh-CN: 支持多个DOM对象
* desc.zh-CN: 支持直接传入多个目标对象的方式引入。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* desc.zh-CN: 支持直接传入多个目标对象的方式引入
* desc.zh-CN: 支持传入多个目标对象

@@ -34,4 +37,4 @@ useClickAway(
| 参数 | 说明 | 类型 | 默认值 |
|---------|----------------------------------------------|------------------------|--------|
| onClickAway | 触发事件的函数 | (event) => void | - |
| target | DOM 节点或者 Ref 对象 | (() => HTMLElement) \| HTMLElement \| React.MutableRefObject | - |
| target | DOM 节点或者 Ref 对象或者 包含该对象的数组 | (() => HTMLElement) \| HTMLElement \| React.MutableRefObject \| ((() => HTMLElement) \| HTMLElement \| React.MutableRefObject)[] | - |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOM 节点或者 Ref 对象,支持数组

@Fadingvision
Copy link
Contributor Author

@brickspert 更新了

@brickspert brickspert requested a review from awmleer August 6, 2020 01:59
Copy link
Collaborator

@brickspert brickspert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@awmleer awmleer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@awmleer awmleer added this to the v2.5.0 milestone Aug 7, 2020
@awmleer awmleer added the enhancement Improvement or optimization label Aug 7, 2020
@awmleer awmleer merged commit 2ac1967 into alibaba:master Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement or optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants