Skip to content
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

fix: 解决移动端下,树形结构展开、收起交互失效的问题 #3037

Closed
wants to merge 5 commits into from

Conversation

gb853940223
Copy link
Contributor

👀 PR includes

✨ Feature

  • New feature

🎨 Enhance

  • Code style optimization
  • Refactoring
  • Change the UI
  • Improve the performance
  • Type optimization

🐛 Bugfix

  • Solve the issue and close #0

🔧 Chore

  • Test case
  • Docs / demos update
  • CI / workflow
  • Release version
  • Other ()

📝 Description

背景:
使用Antv S2进行移动端业务开发,左侧树形图的展收、收起交互失效。
改动点:
在移动端下,左侧树形结构展开、收起交互,不能将整个单元格作为热区,否则会影响到绑定到整个单元格的其他事件,而是适度增加Icon面积,仍然以Icon为交互热区。
问题:
左侧树形结构的展开、收起交互正常,同时又不会影响绑定到整个单元格的其他事件

🖼️ Screenshot

Before After

改动前:
https://github.com/user-attachments/assets/7378823f-60bf-484a-b6fd-20a0d588a1e3
改动后:
https://github.com/user-attachments/assets/b5779263-ca82-4ea2-99bd-d9442034223f

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

Copy link

vercel bot commented Dec 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Dec 12, 2024 9:00am

this.emitCollapseEvent();
});
}
// if (isMobile()) {
Copy link
Member

Choose a reason for hiding this comment

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

这一块直接删掉吧

@@ -519,4 +520,20 @@ export abstract class HeaderCell<
public getActionIcons() {
return this.actionIcons || [];
}

protected getActionIconOffset(iconSize: number) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
protected getActionIconOffset(iconSize: number) {
protected getActionIconOffset(iconSize: number) {
// 移动端的时候,将icon变大,从而增加触发交互的面积
if (isMobile()) {
return {
offsetXY: iconSize / 4;
offsetWH: iconSize / 2;
}
}
return {
offsetXY: 0,
offsetWH: 0,
};
}

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