Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 30, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

closes #5482

💡 需求背景和解决方案

Table 组件点击某行取消高亮后,onActiveChange 回调中 context.activeRowList 仍包含已取消高亮的行数据,与文档描述不符。

根因: handleInactivesingle 模式下硬编码 activeRowList 为当前操作行,而非根据 newActiveRowKeys 计算剩余高亮行。

修复: 与 multiple 模式保持一致,从 newActiveRowKeys 动态计算 activeRowList

// Before: 错误地包含被取消高亮的行
activeRowList: [{ row, rowIndex: index }]

// After: 正确计算剩余高亮行
const activeRowList = [];
for (let i = 0; i < data.value.length; i++) {
  if (newActiveRowKeys.includes(get(data.value[i], props.rowKey))) {
    activeRowList.push({ row: data.value[i], rowIndex: i });
  }
}

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

tdesign-vue-next

  • fix(table): 修复单选模式下取消行高亮时 activeRowList 未正确清空的问题

@tdesign-vue-next/chat

@tdesign-vue-next/auto-import-resolver

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供
Original prompt

This section details on the original issue you should resolve

<issue_title>[Table] 某行数据取消高亮,高亮变化事件中activeRowList未置空</issue_title>
<issue_description>### tdesign-vue-next 版本

1.13.0

重现链接

https://stackblitz.com/run?file=package.json,src%2Fdemo.vue

重现步骤

Table组件点击某行,失去高亮效果后,触发onActiveChange事件,其中返回参数context.activeRowList仍然存在失去高亮的那条记录。官方文档写着:activeRowList表示所有高亮行数据

期望结果

context.activeRowList应该去除失去高亮的数据

实际结果

context.activeRowList仍然存在失去高亮的那条记录

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response</issue_description>

Comments on the Issue (you are @copilot in this section)

@QuentinHsu 你贴的重现链接,不是公开地址 `***/run?***`。麻烦重新贴下。

公开地址在如下图按钮弹窗中可获取:

Image</comment_new>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Nov 30, 2025
Copilot AI changed the title [WIP] Fix activeRowList not updating on row highlight change fix(table): activeRowList not being cleared when row loses highlight in single mode Nov 30, 2025
Copilot AI requested a review from liweijie0812 November 30, 2025 05:10
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 30, 2025

  • tdesign-vue-next-demo

    npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/auto-import-resolver@6222
    
    npm i https://pkg.pr.new/Tencent/tdesign-vue-next@6222
    
    npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/chat@6222
    

commit: d127e6a

@tdesign-bot
Copy link
Collaborator

tdesign-bot commented Nov 30, 2025

TDesign Component Site Preview Open

Component Preview
tdesign-vue-next 完成
@tdesign-vue-next/chat 完成

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Table] 某行数据取消高亮,高亮变化事件中activeRowList未置空

3 participants