Skip to content

fix: unregister array trigger events on release - #4675

Open
biubiukam wants to merge 2 commits into
VisActor:developfrom
biubiukam:fix/issue-4654-array-trigger-release
Open

fix: unregister array trigger events on release#4675
biubiukam wants to merge 2 commits into
VisActor:developfrom
biubiukam:fix/issue-4654-array-trigger-release

Conversation

@biubiukam

@biubiukam biubiukam commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🤔 This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Update dependency
  • Code style optimization
  • Test Case
  • Branch merge
  • Release
  • Site / documentation update
  • Demo update
  • Workflow
  • Other (about what?)

🔗 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 called event.on while releasing a trigger, so releasing a trigger registered the listeners again instead of removing them. This change uses event.off for 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

Language Changelog
🇺🇸 English Fix repeated trigger listeners after release.
🇨🇳 Chinese 修复触发器释放时重复注册数组事件监听器的问题。

A Rush patch changefile for @visactor/vchart has been added in commit f3c05341a.

☑️ Self-Check before Merge

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

🚀 Summary

Fix array-valued trigger event cleanup in BaseTrigger.release() and add the package patch changelog entry.

🔍 Walkthrough

  • Change the release path from event.on to event.off for each array event.
  • Add a unit test proving both listeners are removed without re-registering them.
  • Add a Rush patch changefile for the user-visible behavior fix.

@biubiukam
biubiukam marked this pull request as ready for review August 28, 2026 19:11

@xuefei1313 xuefei1313 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦞 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/文档说明。

@github-actions github-actions Bot added the chore label Aug 31, 2026
@biubiukam

Copy link
Copy Markdown
Contributor Author

评估结论:该问题属于用户可感知的行为修复,需要补充 release changelog;但没有新增或变更公开 API、配置字段或使用方式,因此不需要额外文档或 demo。已在提交 f3c0534 中添加 @visactor/vchart 的 patch changefile,并完成完整 Rush 测试(78 个 suite、405 个测试全部通过)。

@Issues-translate-bot

Copy link
Copy Markdown

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] BaseTrigger.release re-registers array-valued event handlers

3 participants