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

🤔动态滚动表格,表格内部方法报错 #2539

Closed
4 tasks
xinxin12138 opened this issue Feb 2, 2024 · 3 comments
Closed
4 tasks

🤔动态滚动表格,表格内部方法报错 #2539

xinxin12138 opened this issue Feb 2, 2024 · 3 comments
Labels
❔question 疑问/使用问题

Comments

@xinxin12138
Copy link

🏷 Version

Package Version
@antv/s2 1.49.2
@antv/s2-react
@antv/s2-vue

Sheet Type

  • PivotSheet
  • [✓ ] TableSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Description

表格滚动,动态设置表格滚动时长,表格内部方法报错,如下图:
表格绘制及滚动方法.txt
f677aeb32b920891f74e9a1b1a88ed6
b313b4dffa2bbf50514a9f9910c7d90

🔗 Reproduce Link

😊 Expected Behavior

希望能告知,这个add方法报错,会是什么原因引起的

😅 Current Behavior

@xinxin12138 xinxin12138 added the ❔question 疑问/使用问题 label Feb 2, 2024
@lijinke666 lijinke666 added the 🤔 need reproduce 需要一个在线复现链接 label Feb 2, 2024
Copy link
Contributor

github-actions bot commented Feb 2, 2024

你好 @xinxin12138,请提供一个可以在线访问的链接, 或者使用 codesandbox 提供示例并详细说明复现步骤 (查看更多模板), 15 天内未回复issue自动关闭。

Hello, @xinxin12138, please provide an accessible link or usage codesandbox to describe the reproduction steps (more template). The issue will be closed without any replay within 15 days.

@xinxin12138
Copy link
Author

https://codesandbox.io/p/sandbox/lucid-voice-kprzk4?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522cls48tnmc0006356hehb3rw61%2522%252C%2522sizes%2522%253A%255B100%252C0%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522cls48tnmb0002356hnhxbsyt1%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522cls48tnmb0003356hwkncnyoo%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522cls48tnmb0005356hvhqfrrsv%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522cls48tnmb0002356hnhxbsyt1%2522%253A%257B%2522id%2522%253A%2522cls48tnmb0002356hnhxbsyt1%2522%252C%2522tabs%2522%253A%255B%255D%257D%252C%2522cls48tnmb0005356hvhqfrrsv%2522%253A%257B%2522id%2522%253A%2522cls48tnmb0005356hvhqfrrsv%2522%252C%2522activeTabId%2522%253A%2522cls49njej008t356hckdpax7w%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A0%252C%2522id%2522%253A%2522cls49njej008t356hckdpax7w%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252F%2522%257D%255D%257D%252C%2522cls48tnmb0003356hwkncnyoo%2522%253A%257B%2522tabs%2522%253A%255B%255D%252C%2522id%2522%253A%2522cls48tnmb0003356hwkncnyoo%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Afalse%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

@github-actions github-actions bot removed the 🤔 need reproduce 需要一个在线复现链接 label Feb 2, 2024
@lijinke666
Copy link
Member

这个错误通常是表格销毁了, 但是你还在继续渲染表格导致的 (类似的问题 #2435), 你可以自己打断点看下是不是这样, 结合你的代码来看, 是有计时器没有被清除掉, 你可以尝试

  • 在你手动 destory 之前, 就清除计时器, 避免表格销毁了还在调用 updateScrollOffset scrollWithAnimation 等会引起表格重渲染的方法.
  • 参考这里的实现, 判断 Canvas 的 s2.container.get('refreshElements') 存在再触发表格滚动.

// G 底层 refreshElements 默认是个数组, 销毁时获取不到, 没有兜底 https://github.com/antvis/S2/issues/2435
if (this.destroyed || (canvas && !canvas.get('refreshElements'))) {
DebuggerUtil.getInstance().logger(`GuiIcon ${name} destroyed.`);
return;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❔question 疑问/使用问题
Projects
None yet
Development

No branches or pull requests

2 participants