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

Trigger 组件设置了clickOutsideToClose.capture true, 控制台会一直报错 #2677

Open
1 task
ywf2016 opened this issue May 10, 2024 · 0 comments
Open
1 task

Comments

@ywf2016
Copy link

ywf2016 commented May 10, 2024

Basic Info

  • Package Name And Version: @arco-design/web-react@2.62.0
  • Browser: chrome124.0.0.0

Extra info

arco-design/components/Trigger/index.tsx

这里 off 并未给 capture 参数

off(root, 'mousedown', this.onClickOutside);

What is expected?

预期能够正确取消事件监听

Steps to reproduce

  1. 组件设置
    clickOutsideToClose={{
    capture: true,
    }}

  2. 点击按钮,打开弹窗,然后控制台输入代码 getEventListeners(document)['mousedown'][0],发现已经正确监听了事件

  3. 点击空白位置,关闭弹窗,再次输入前一步代码,发现事件还在

PS:通过设置 capture 为 false 可以作为对比

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

1 participant