fix: unregister array trigger events on release - #4675
Conversation
xuefei1313
left a comment
There was a problem hiding this comment.
🦞 Aime Bot Review
改动摘要
- 仓库:VisActor/VChart
- PR:#4675 fix: unregister array trigger events on release
- 作者:@biubiukam
- 创建时间:2026-08-29 03:09:41+08:00
代码观察
- 变更规模:2 files, +30/-1
- 变更文件(Top 12):
packages/vchart/__tests__/unit/interaction/base-trigger.test.ts(added, +29/-0)packages/vchart/src/interaction/triggers/base.ts(modified, +1/-1)
建议
- 整体看起来结构清晰;建议自测覆盖关键渲染/交互路径,并在描述中补充变更动机与影响范围。
合并建议
建议在自测通过、并确认风险可控后合并 ✅。若这是行为修复/用户可见变更,建议补充 changelog/文档说明。
|
评估结论:该问题属于用户可感知的行为修复,需要补充 release changelog;但没有新增或变更公开 API、配置字段或使用方式,因此不需要额外文档或 demo。已在提交 f3c0534 中添加 @visactor/vchart 的 patch changefile,并完成完整 Rush 测试(78 个 suite、405 个测试全部通过)。 |
Evaluation conclusion: This problem is a user-perceivable behavior fix, and the release changelog needs to be supplemented; however, there are no new or changed public APIs, configuration fields, or usage methods, so no additional documentation or demo is required. The patch changefile of @visactor/vchart has been added to commit f3c0534, and the complete Rush test has been completed (all 78 suites and 405 tests passed). |
🤔 This is a ...
🔗 Related issue link
close #4654
🔗 Related PR link
N/A
🐞 Bugserver case id
N/A
💡 Background and solution
BaseTrigger.release()supports both single event names and arrays of event names. The array branch incorrectly calledevent.onwhile releasing a trigger, so releasing a trigger registered the listeners again instead of removing them. This change usesevent.offfor each array entry and adds a regression test covering both event names.The impact is limited to interaction trigger cleanup: releasing a trigger with an array-valued event no longer re-registers its listeners. There is no public API, configuration, type definition, or usage change.
📝 Changelog
A Rush patch changefile for
@visactor/vcharthas been added in commitf3c05341a.☑️ Self-Check before Merge
🚀 Summary
Fix array-valued trigger event cleanup in
BaseTrigger.release()and add the package patch changelog entry.🔍 Walkthrough
event.ontoevent.offfor each array event.