Skip to content

fix: 修复移动端点击事件触发多次 #3141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 11, 2025
Merged

Conversation

Create-Peace
Copy link
Contributor

👀 PR includes

🐛 Bugfix

  • 解决移动端点击事件多次触发

📝 Description

移动端点击单元格触发两次事件回调

🖼️ Screenshot

Before After
image image

🔗 Related issue link

🔍 Self-Check before the merge

@github-actions github-actions bot added the next 2.0-next 版本的问题 label Apr 3, 2025
Copy link
Contributor

github-actions bot commented Apr 3, 2025

你好 @Create-Peace,非常感谢你的贡献.
为了让代码更健壮, 请根据 贡献指南 补充相应单元测试 (文档改动或其他特殊场景除外), 如果有 API 改动, 请修改 相应的文档.
同时请检查 linttest 相关 CI 是否通过, 如果失败, 请点击 [Details] 按钮查看, 并根据日志修复.

Hello, @Create-Peace, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the docs if there are API changes.
At the same time, please check whether the CI related to lint and test passes. If the CI fails, please click [Details] button to check and repair according to the log.

Copy link

Walkthrough

此PR修复了移动端点击事件触发多次的问题。通过在事件控制器中根据设备类型选择合适的点击事件(TOUCH_END或POINTER_UP),避免了移动端点击单元格时事件回调被触发两次的情况。

Changes

文件 概要
packages/s2-core/src/common/constant/events/origin.ts 添加了TOUCH_END事件常量。
packages/s2-core/src/interaction/event-controller.ts 根据设备类型选择合适的点击事件,修复了移动端点击事件触发多次的问题。

@Alexzjt
Copy link
Contributor

Alexzjt commented Apr 8, 2025

@Create-Peace 单元测试没有过

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.48%. Comparing base (ecdc9c8) to head (d1f7fd0).
Report is 654 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3141      +/-   ##
==========================================
+ Coverage   75.77%   80.48%   +4.70%     
==========================================
  Files         257      166      -91     
  Lines       11994    10400    -1594     
  Branches     2464     2377      -87     
==========================================
- Hits         9088     8370     -718     
+ Misses       1398      579     -819     
+ Partials     1508     1451      -57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Alexzjt Alexzjt changed the title 修复移动端点击事件触发多次 fix: 修复移动端点击事件触发多次 Apr 11, 2025
@github-actions github-actions bot added the pr(fix) bug fix label Apr 11, 2025
@Alexzjt Alexzjt merged commit 48cb5ee into antvis:next Apr 11, 2025
11 checks passed
@Alexzjt
Copy link
Contributor

Alexzjt commented Apr 11, 2025

感谢你的贡献

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 pr(fix) bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants