antvis/G6

如果在添加数据时切换到其他标签页,然后再切回来,可能会导致图表渲染的问题 #5155

yeyusama posted onGitHub

问题描述

image 1700124458486

在点击加载新增子节点的时候 会去请求后台接口 再去渲染页面 这个过程需要时间,当我在等待加载的时候切换到了另外一个TAB页面去浏览其他的内容 过了一段时间再切换回原页面的时候,这时候请求已经返回。但是 加载出来的数据渲染出来错位了是为什么呢? 如果在加载数据时切换到其他标签页,然后再切回来,可能会导致图表渲染的问题。 这种问题应该如何解决

重现链接

https://github.com/antvis/G6/issues/new?assignees=&labels=&projects=&template=bug_report_chinese.yml

重现步骤

image

预期行为

期望能够正常渲染

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

1700124458486

补充说明(可选)

No response


Hi @yeyusama, Please star this repo if you find it useful! Thanks :star:! 你好 @yeyusama。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

posted by github-actions[bot] over 1 year ago

有人知道这个问题如何解决吗

posted by yeyusama over 1 year ago

该问题可能与浏览器策略有关,暂无相关解决方式,你可以通过监听浏览器事件,在当前tab激活的情况下才执行渲染

posted by Aarebecca 11 months ago

Fund this Issue

$0.00
Funded

Pull requests