Skip to content

Conversation

@newstart0514
Copy link
Contributor

@newstart0514 newstart0514 commented Feb 11, 2026

🤔 这个分支是...

  • 新功能
  • Bug fix
  • Ts 类型更新
  • 打包优化
  • 性能优化
  • 功能增强
  • 重构
  • 依赖版本更新
  • 代码优化
  • 测试 case 更新
  • 分支合并
  • 网站/文档更新
  • demo 更新
  • Workflow
  • 配置修改
  • 发布
  • 其他

🔗 相关 issue 连接

fix #5006

💡 问题的背景&解决方案

背景
用户反馈在部分交互下会出现“清理慢一拍”的现象:第二次选择未清掉第一次残留,第三次才清掉第二次。说明选中状态与边框组件在某些路径可能存在不同步。

解决方案
本次改动不再使用等价替换(dealTableSelect() -> updateSelectPos(-1, -1)),改为稳定清理策略:

  1. StateManager 增加 clearSelectState(),强制清空 ranges/cellPos/selecting/isSelectAll,并执行 deleteAllSelectBorder()
  2. outsideClickDeselect 路径改为调用 clearSelectState(true),确保外部点击时旧选区被彻底清空;
  3. 在新一轮单选开始前,清理条件改为基于 ranges.length > 0,避免依赖 cellPos 导致的“上一轮残留延迟到下一轮才清理”。

这样可以覆盖“第一次没正常清除”的慢一拍场景,并让清理语义更一致。

📝 Changelog

Language Changelog
🇺🇸 English fix: stabilize deselect flow to avoid stale previous selection
🇨🇳 Chinese 修复选区清理慢一拍问题,外部点击与下一次单选前均执行稳定清理

☑️ 自测

  • 文档提供了,或者更新,或者不需要
  • Demo 提供了,或者更新,或者不需要
  • Ts 类型定义提供了,或者更新,或者不需要
  • Changelog 提供了,或者不需要

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

@newstart0514
Copy link
Contributor Author

劳烦不要合并这么快,等待issue复现示例验证

@newstart0514 newstart0514 changed the title fix: clear selection on outside click when outsideClickDeselect is true fix: stabilize deselect flow for outside click and next selection Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] VTable单元格选中状态无法消除

1 participant