hooks icon indicating copy to clipboard operation
hooks copied to clipboard

fix(useClickAway): callback shouldn't be invoked when a dynamic element inside target is clicked

Open liuyib opened this issue 1 year ago • 1 comments

[中文版模板 / Chinese template]

🤔 This is a ...

  • [ ] New feature
  • [x] Bug fix
  • [ ] Site / documentation update
  • [ ] Demo update
  • [ ] TypeScript definition update
  • [ ] Bundle size optimization
  • [ ] Performance optimization
  • [ ] Enhancement feature
  • [ ] Internationalization
  • [ ] Refactoring
  • [ ] Code style optimization
  • [ ] Test Case
  • [ ] Branch merge
  • [ ] Other (about what?)

🔗 Related issue link

fix: https://github.com/alibaba/hooks/issues/2321

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English fix(useClickAway): callback shouldn't be invoked when a dynamic element inside target is clicked
🇨🇳 Chinese fix(useClickAway): 点击目标元素内部的动态元素时,不应该调用回调

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • [x] Doc is updated/provided or not needed
  • [x] Demo is updated/provided or not needed
  • [x] TypeScript definition is updated/provided or not needed
  • [x] Changelog is provided or not needed

liuyib avatar Apr 24 '24 08:04 liuyib

这个 PR 的变动单测模拟不出来,按照 https://github.com/alibaba/hooks/issues/2321#issue-1892386450 的 demo,人工是可以复现出问题,并且这个 PR 确实能解决问题,但是单测里复现不了,所以就没补单测

liuyib avatar Apr 25 '24 12:04 liuyib