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

🐛 拖动水平滚动条后部分列头单元格选中状态被重置 #2503

Closed
1 of 5 tasks
xulingling0 opened this issue Jan 9, 2024 · 4 comments · Fixed by #2545
Closed
1 of 5 tasks

🐛 拖动水平滚动条后部分列头单元格选中状态被重置 #2503

xulingling0 opened this issue Jan 9, 2024 · 4 comments · Fixed by #2545
Assignees

Comments

@xulingling0
Copy link

xulingling0 commented Jan 9, 2024

🏷 Version

Package Version
@antv/s2 1.54.2
@antv/s2-react 1.46.0
@antv/s2-vue

Sheet Type

  • PivotSheet
  • TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

拖动水平滚动条后部分列头单元格选中状态被重置

⌨️ Code Snapshots

🔗 Reproduce Link

https://codesandbox.io/p/sandbox/morning-feather-frcny6?file=%2Findex.tsx%3A11%2C18

🤔 Steps to Reproduce

  1. 选中列头
    image
  2. 拖动水平滚动条
  3. 查看列选中状态
    image

😊 Expected Behavior

拖动水平滚动条后,希望所有的列头单元格选中状态保留

😅 Current Behavior

拖动水平滚动条后,部分列头单元格选中状态被重置

🤔 Analyze

  1. 选中列头后,源码中调用 selectHeaderCell 方法,nodes 未包括非叶子节点的列头
    image
    通过 highlightNodes 高亮非叶子节点的列头
    image

  2. 滚动导致单元格状态被重置,拿取的上一步的选中信息,通过 handleSelect 判断是否显示单元格,非叶子节点的列头未命中条件
    image

  3. 其他
    通过 highlightNodes 单独实现非叶子节点的列头选中效果,会导致选择多个列头时,上一个列头的非叶子节点的列头选中状态丢失
    image

💻 System information

Environment Info
System all
Browser all
@lijinke666 lijinke666 added the 🐛 bug 这个是一个 bug label Jan 12, 2024
Copy link
Contributor

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

Hello, @xulingling0, 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.

@lijinke666 lijinke666 self-assigned this Feb 5, 2024
lijinke666 added a commit that referenced this issue Feb 23, 2024
* fix(interaction): 修复表格滚动后, 行列头部分单元格选中高亮效果丢失 close #2503

* chore: 还原

* test: 修复单测

* test: 修复单测

---------

Co-authored-by: Wenjun Xu <[email protected]>
@lijinke666
Copy link
Member

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

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member

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

The release is available on:

Your semantic-release bot 📦🚀

lijinke666 added a commit that referenced this issue Feb 26, 2024
* fix(interaction): 修复表格滚动后, 行列头部分单元格选中高亮效果丢失 close #2503

* chore: 还原

* test: 修复单测

* test: 修复单测

---------

Co-authored-by: Wenjun Xu <[email protected]>
@lijinke666
Copy link
Member

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

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
2 participants