-
Notifications
You must be signed in to change notification settings - Fork 199
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: 解决移动端下,树形结构展开、收起交互失效的问题 #3038
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
this.treeIcon = renderTreeIcon({ | ||
group: this, | ||
iconCfg: { | ||
x: iconX, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不建议增大 icon 的尺寸, 和 pc 表现不一致有一点奇怪
}); | ||
|
||
// 移动端, 点击热区为整个单元格 | ||
if (isMobile()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移动端热区还是不变, 把 click 改成 touched
就能解决这个问题
if (isMobile()) {
this.addEventListener('touched', () => {
this.emitCollapseEvent();
});
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个方案不妥,如果把整个单元格做为热区的话,单元格上的Tooltip就无法触发。所以我才考虑把icon放大
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前也考虑过这个方案
); | ||
this.onTreeIconClick(isCollapsed); | ||
}, | ||
onTouchEnd: () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
角头这里还是热区绑定单元格即可, 和 row-cell 一致
if (isMobile()) {
this.addEventListener('touched', () => {
this.emitCollapseEvent();
});
}
👀 PR includes
✨ Feature
🎨 Enhance
🐛 Bugfix
🔧 Chore
📝 Description
背景:
使用Antv S2进行移动端业务开发,左侧树形图的展收、收起交互失效。
改动点:
在移动端下,左侧树形结构展开、收起交互,不能将整个单元格作为热区,否则会影响到绑定到整个单元格的其他事件,而是适度增加Icon面积,仍然以Icon为交互热区。
问题:
左侧树形结构的展开、收起交互正常,同时又不会影响绑定到整个单元格的其他事件
🖼️ Screenshot
🔗 Related issue link
🔍 Self-Check before the merge