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

🐛S2父级及以上的节点,添加了transform: scale(1.1)后,透视表分组排序按钮失效;(设置supportCSSTransform后依然无效) #2879

Closed
1 of 5 tasks
Karl-Xu opened this issue Aug 28, 2024 · 10 comments · Fixed by #2942
Assignees

Comments

@Karl-Xu
Copy link

Karl-Xu commented Aug 28, 2024

🏷 Version 1.55.8

Package Version
@antv/s2 1.55.8
@antv/s2-react 1.47.0
antd 4.24.16
react 18.3.1
react-dom 18.3.1

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

在S2表格的父级及以上的任意结点,添加transform: scale(1.1)样式后,透视表的分组排序按钮失效;通过调试及源码解读,因是点击位置已经不在S2的原始设定范围内,导致无法正确获取canvas内部点击位置
image
也曾尝试官网的高清适配方案,但是两种场景并不相同,changSheetSize后仍受控与父级scale css样式影响
特别备注:原bug提交后给出了修复方案,但该方案尝试无用,因无法reopen issue,故不得已,又开了一个
image
原issue链接:#2849

⌨️ Code Snapshots

使用官网示例:https://s2-v1.antv.antgroup.com/examples/analysis/sort#group-sort
并修改示例项目中的index.html文件,内容更改为:


image

🔗 Reproduce Link

修改后的codeSandbox连接:https://codesandbox.io/s/silly-gould-v447zf?file=/index.html

🤔 Steps to Reproduce

放大前:
image
放大后:
image

😊 Expected Behavior

希望放大后组内排序按钮功能正常;另,我们尝试使用S2 2.x版本,发现存在这样的问题

😅 Current Behavior

父级配置scale放大后,组内排序按钮失效

💻 System information

Environment Info
System macOS Sonoma 14.5
Browser chrome: v127.0.6533.89
@Karl-Xu
Copy link
Author

Karl-Xu commented Aug 28, 2024

特别备注:原bug提交后给出了修复方案,但该方案尝试无用,因无法reopen issue,故不得已,又开了一个
image
原issue链接:#2849

@Karl-Xu Karl-Xu changed the title 🐛S2父级及以上的节点,添加了transform: scale(1.1)后,透视表分组排序按钮失效 🐛S2父级及以上的节点,添加了transform: scale(1.1)后,透视表分组排序按钮失效;(设置supportCSSTransform后依然无效) Aug 28, 2024
@lijinke666
Copy link
Member

在官网能复现吗? 开启 supportCSSTransform 后, 1.x 和 2.x 一切正常, 你提供的 demo 和官网均未复现.

Kapture 2024-09-10 at 19 00 13

@lijinke666 lijinke666 self-assigned this Sep 10, 2024
@Karl-Xu
Copy link
Author

Karl-Xu commented Sep 12, 2024

我提供的demo可以复现,点击“笔”列下的“价格”功能正常,因为该点击范围还在原尺寸大小之下;请点击“纸张”列下的“价格”的小三角icon。那个icon超出了原有表格尺寸大小,所以被判定为不在渲染范围内了
vt8lw-3lr2e

@Karl-Xu
Copy link
Author

Karl-Xu commented Sep 24, 2024

在官网能复现吗? 开启 supportCSSTransform 后, 1.x 和 2.x 一切正常, 你提供的 demo 和官网均未复现.

Kapture 2024-09-10 at 19 00 13 Kapture 2024-09-10 at 19 00 13

Hello,我提供的demo可以复现,点击“笔”列下的“价格”功能正常,因为该点击范围还在原尺寸大小之下;请点击“纸张”列下的“价格”的小三角icon。那个icon超出了原有表格尺寸大小,所以被判定为不在渲染范围内了
vt8lw-3lr2e

@lijinke666
Copy link
Member

lijinke666 commented Sep 24, 2024

supportCSSTransform 是生效了的, 看了下是 点击空白处重置交互 导致的, 可以先关闭 autoResetSheetStyle 规避

    const s2Options = {
      width: 600,
      height: 480,
      showDefaultHeaderActionIcon: true, // 默认打开
      supportCSSTransform: true,
+     interaction: {
+       autoResetSheetStyle: false
+     }
    };

由于外层有 transform, 导致判断 "是否点击了表格外区域" 有问题, 感兴趣的话可以来个 PR, 近期有点忙, 可能要晚一点修复

if (
this.isMouseOnTheTooltip(event) ||
this.isMouseOnTheCanvasContainer(event)
) {
return;
}

@lijinke666 lijinke666 added the 🐛 bug 这个是一个 bug label Sep 24, 2024
Copy link
Contributor

你好 @Karl-Xu,很抱歉给你带来了不好的体验, 我们会尽快排查问题并修复, 请关注后续发布日志.

Hello, @Karl-Xu, We are so sorry for the bad experience. We will troubleshoot and fix the problem as soon as possible. Please pay attention to the follow-up change logs.

@Karl-Xu
Copy link
Author

Karl-Xu commented Oct 16, 2024

autoResetSheetStyle: false

配置autoResetSheetStyle: false后确实可以显示下拉框了,但同时因为autoResetSheetStyle: false,所以点击空白区域无法关闭下拉框了,这个还是等修复吧。

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-v1.56.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-v2.0.0-next.30 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

🎉 This issue has been resolved in version @antv/s2-react-v2.0.0-next.29 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
@Karl-Xu @lijinke666 and others