fix(components-library-react): clear removed event handler cache#19301
Open
Cookie726 wants to merge 1 commit into
Open
fix(components-library-react): clear removed event handler cache#19301Cookie726 wants to merge 1 commit into
Cookie726 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
总览attachProps.ts 中 变更事件监听移除与缓存清理
代码审查工作量🎯 2 (简单) | ⏱️ ~8 分钟
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Jun 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这个 PR 做了什么? (简要描述所做更改)
修复了 Taro H5 下 React 组件库事件解绑后无法用同一 handler 重新绑定的问题。
问题可通过如下代码复现:
在上述场景中,
onClick会经历handleClick -> undefined -> handleClick的切换:loading恢复为false后,第二次点击在 Taro H5 下失效原因是
syncEvent在移除事件监听时,没有同步清理node.__events中的缓存,导致后续再次传入同一个 handler 时被误判为事件已存在,进而跳过重新绑定。本 PR 的修复内容:
eventStore[eventName]handler -> undefined -> same handler的场景下可以正确重新绑定事件这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
Summary by CodeRabbit
发布说明