表头checkbox的半选状态不对
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 486
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Description
场景:
cellType: function ({ table, col, row }) {
if (table.isAggregation(col, row)) {
return "text";
}
return "checkbox";
}
当cellType配置为函数时,某些单元格不需要渲染checkbox,比如示例代码中的合计栏。这个时候,表头的半选状态出现的不合理,如图所示:
原因分析:
checkbox.ts 中 initCheckedState 函数初始化时对所有record都初始化了一个状态,而 updateHeaderCheckedState函数计算半选状态时,又没有排除掉。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/vtable/src/state/checkbox/checkbox.ts, reading initCheckedState and updateHeaderCheckedState. Reproduce the example with a cellType function that returns text for aggregation cells, then inspect how those records affect the header checkbox state. Done means the header's half-selected state reflects only cells that render checkboxes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- Half a day
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100