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

fix: 修复表格卸载后, 高清适配逻辑还会触发的问题 #2965

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

linwrui
Copy link
Contributor

@linwrui linwrui commented Nov 8, 2024

👀 PR includes

✨ Feature

  • New feature

🎨 Enhance

  • Code style optimization
  • Refactoring
  • Change the UI
  • Improve the performance
  • Type optimization

🐛 Bugfix

  • 解决启用高清适配时因 resize 事件的异步执行导致的报错问题

🔧 Chore

  • Test case
  • Docs / demos update
  • CI / workflow
  • Release version
  • Other ()

📝 Description

  1. 项目中使用了浏览器全屏演示表格组件,并配置了缩放比例,启用了高清适配属性

  2. 在退出全屏时主动销毁了表格组件,但因为退出全屏的同时触发了 resize 事件,而经过查看源码发现 resize 事件的处理器是异步执行并且使用了防抖函数,导致该事件的执行时机滞后于 spreadsheet 的销毁时机,进而导致后续过程的报错,浏览器控制台报错信息如下:
    image
    image

  3. 在 hdAdapter 销毁后添加 destroyed 标识,并在 resize 事件处理器执行前检查是否已销毁,避免后续过程报错

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

Copy link

vercel bot commented Nov 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Nov 8, 2024 6:52am

@linwrui linwrui changed the base branch from master to next November 8, 2024 03:10
@github-actions github-actions bot added the next 2.0-next 版本的问题 label Nov 8, 2024
@linwrui linwrui removed their assignment Nov 8, 2024
@lijinke666 lijinke666 changed the title Feat hd adapter destroy fix: 修复表格卸载后, 高清适配逻辑还会触发的问题 Nov 8, 2024
@github-actions github-actions bot added the pr(fix) bug fix label Nov 8, 2024
@lijinke666
Copy link
Member

感谢你的贡献, 该场景特殊, 就不用写单测了

@lijinke666 lijinke666 merged commit c837efe into antvis:next Nov 8, 2024
9 of 11 checks passed
@linwrui linwrui deleted the feat-hdAdapter-destroy branch November 8, 2024 07:45
@lijinke666
Copy link
Member

🎉 This PR is included in version @antv/s2-v2.0.0-next.32 🎉

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 版本的问题 pr(fix) bug fix released on @next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants