fix(vue-vtable): resolve DOM component flickering during column resize (#5038)#5100
Open
Erica-cod wants to merge 1 commit intoVisActor:developfrom
Open
fix(vue-vtable): resolve DOM component flickering during column resize (#5038)#5100Erica-cod wants to merge 1 commit intoVisActor:developfrom
Erica-cod wants to merge 1 commit intoVisActor:developfrom
Conversation
VisActor#5038) Inject stable cache IDs in customLayoutUtils. Sync render on cache hit to prevent clearCacheContainer race. Made-with: Cursor
Contributor
Author
|
修复效果: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 这个分支是...
🔗 相关 issue 连接
fix #5038
💡 问题的背景&解决方案
问题: 使用 Vue DOM 组件(如 ArcoDesign Tag、Comment)渲染单元格内容时,拖动调整列宽会导致 DOM 内容严重闪烁。
根因: 列宽拖拽的每一帧,核心层都会对 custom container 执行销毁+重建,新的 scene graph graphic 拥有新的 _uid。Vue 插件的 renderGraphicHTML 是异步的(rAF 延迟到下一帧),但 clearCacheContainer 是同步的(当帧立即执行)。_uid 变化导致缓存 key 失效,旧 DOM 被清除而新 DOM 要等下一帧才创建,每帧至少 1 帧 DOM 空白期。React 不受影响是因为它的 renderGraphicHTML 是同步的。
调研后决定不改核心层: 在核心层跳过 removeChild+dealWithCustom 影响范围太大(React/Vue/Canvas 三种 customLayout 全受影响),且跳过 dealWithCustom 意味着 customLayout 函数不会以新宽度重新执行,对纯 Canvas 布局可能产生错误。闪烁的可见症状完全由 Vue 插件异步渲染+不稳定缓存 key 导致,只改 Vue 侧即可消除。
修复方案(仅改 vue-vtable 包):
📝 Changelog
☑️ 自测