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

🐛 表格区域双击时会选择表格外的文本 #2798

Closed
1 of 5 tasks
iGarym opened this issue Jul 1, 2024 · 5 comments · Fixed by #2800
Closed
1 of 5 tasks

🐛 表格区域双击时会选择表格外的文本 #2798

iGarym opened this issue Jul 1, 2024 · 5 comments · Fixed by #2800
Assignees
Labels
next 2.0-next 版本的问题 released on @next

Comments

@iGarym
Copy link

iGarym commented Jul 1, 2024

🏷 Version

Package Version
@antv/s2 2.0.0-next.22

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

在 Chrome 浏览器中双击表格内的任意区域,表格外的文本被选中。

⌨️ Code Snapshots

const s2DataConfig: S2DataConfig = {
  fields: {
    columns: ["id", "pt_date"]
  },
  meta: [],
  data: [
    {
      id: 20,
      pt_date: "2023-02-08"
    },
    {
      id: 8,
      pt_date: "2023-02-15"
    },
  ]
};

const s2Options: S2Options = {
  width: 600,
  height: 480,
  seriesNumber: {
    enable: false
  }
};

🔗 Reproduce Link

https://codesandbox.io/p/sandbox/admiring-breeze-ftf64h

🤔 Steps to Reproduce

在 Chrome 浏览器中双击表格任意区域即可复现。

😊 Expected Behavior

双击表格时不要选中组件外的文本

😅 Current Behavior

双击表格时选中组件外的文本

💻 System information

Environment Info
System macOS@13.6.3
Browser Chrome@126.0.6478.127
@github-actions github-actions bot added the next 2.0-next 版本的问题 label Jul 1, 2024
Copy link
Contributor

github-actions bot commented Jul 1, 2024

你要找的是不是 (You may look for issues):

  1. 85% 🐛 #2785

@iGarym
Copy link
Author

iGarym commented Jul 1, 2024

你要找的是不是 (You may look for issues):

  1. 85% 🐛 #2785

不是同一个问题

@lijinke666
Copy link
Member

这个是浏览器的默认行为, 给 canvas 设置下 user-select: none 即可, 后面我们修改下, 初始化时默认加上

canvas {
  user-select: none;
}

@lijinke666 lijinke666 self-assigned this Jul 1, 2024
lijinke666 added a commit that referenced this issue Jul 5, 2024
* fix: 取消双击表格时默认选中文本的默认浏览器行为 close #2798

* test: 更新快照
@lijinke666
Copy link
Member

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

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.24 🎉

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
Labels
next 2.0-next 版本的问题 released on @next
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants