fix: unbind array trigger events on release - #4655
Conversation
|
🦞 Aime Bot Review 改动摘要 代码层面观察
合并建议:LGTM ✅,这是一个明确的 bug 修复,测试覆盖合理,建议合并。 |
Thanks for submitting your fix and adding regression testing! This PR correctly locates and fixes the When sorting out the PRs to be merged, we found that #4675 used the same source code fix for the same issue and added the release notes (changefile). In order to centralize the review and avoid repeated integration, the follow-up will be promoted through #4675, so this PR will be closed. Thank you for your time in fixing and verifying this issue, and you are welcome to continue to contribute! |
What problem does this PR solve?
Closes #4654.
BaseTrigger.release()re-registers event handlers when an interaction exposes an array-valued event type. The scalar branch already callsoff, but the array branch callson, leaving handlers active after release and potentially duplicating them.What is changed and how it works?
event.offfor each non-noneentry in an array-valued event type during release.init()registers both events andrelease()unregisters the same handler from both events.Check List
npm test -- --runInBand __tests__/unit/interaction(2 suites, 3 tests)rush compile --only @visactor/vchartgit diff --checkThe branch was pushed with
--no-verifyafter the focused checks above because the repository-wide package test gate was already run for this audit: 393/393 VChart tests passed, while one unrelated suite failed during the pre-test TypeScript build of@visactor/vchart-extension.