Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug] mergeCell 合并区间部分超出可视区域时,合并标签被画在两个位置(1.26.7 回归,PR #5284 引入)

Aperta
#5,336 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, typescript

Direzione di ricerca

The bug is in packages/vtable/src/scenegraph/stick-text/index.ts, in dealMergedCellGroups, where the merged range is clipped to visibleRange and dealVertical adjusts dy only for visible text nodes. Read that clipping logic and compare it with how adjustCellContentVerticalLayout handled merged ranges in 1.26.6 via getCellMergeRange. Done means a merged cell whose range is cut off by the viewport draws its label once, with every singleCellGroup in the range sharing the same dy. Settle on fix option (a) or (b) with a maintainer before coding.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Version

1.26.7 / 1.26.8

Link to Minimal Reproduction

ListTable,配置: - 某列 mergeCell: true 且 textStick: true(纵向合并行数超过可视区域行数) - 容器高度调小,使合并区间被可视区底边"切断"

Steps to Reproduce
  1. 创建 ListTable,A 列设置 mergeCell: true, textStick: true,构造约 8 条连续相同取值的记录,使第 N~N+7 行纵向合并。
  2. 将容器高度调小到只能看到 N~N+3 行。
  3. 触发任意一次会执行 handleTextStick 的刷新(autoRowHeight 初次渲染 / 滚动 / 容器 resize 均可)。
Current Behavior

合并标签被绘制在两个不同的 y 位置:合并区间中可见部分的 text 子节点被 dealVertical 调整了 dy,
区间外不可见部分的 text 子节点仍保持旧的基准 dy。视觉上合并"断开"成两块。

Expected Behavior

合并区间内所有 singleCellGroup 的 dy 偏移保持一致,标签只绘制一次(与 1.26.6 一致)。

Environment
- OS: macOS / Windows
- Browser: Chrome
- Framework: React(react-vtable),但问题在 vtable core 中
Any additional comments?
根因分析

PR #5284(修复 #3752)重写了 packages/vtable/src/scenegraph/stick-text/index.ts:
dealMergedCellGroups 现在把合并区间的处理裁剪到当前可视窗口(visibleRange 取交集),
并加了 updateId 去重。当纵向合并区间部分超出可视区域时,只有可见行的 text 子节点会收到
dealVertical 的 dy 调整,同一合并区间其余行的 text 保持旧的基准 dy。
由于 boolean mergeCell 的实现是区间内每个 cellGroup 都携带一个 text 子节点、靠各自 dy 叠加到
同一视觉位置,同一标签就会以两个绝对位置各渲染一次。

该 PR 之前,adjustCellContentVerticalLayout 处理合并单元格时遍历整个合并区间
(getCellMergeRange),与是否可见无关,因此所有 cell 始终一致。

可能的修复方向

裁剪到可视范围时,需要保证同一合并区间中不可见的 singleCellGroup:
(a) 与可见部分保持/恢复一致的基准 dy;或
(b) 不被渲染(而不是带着过期偏移渲染)——
即合并区间的 text 定位应作为一个整体处理,即使只处理了其中一部分。

Lingua principale
TypeScript
Stelle
3.7k
Fork
492
Merge medio
19h 48m
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di VisActor/VTable

Tutte le issue di VisActor/VTable

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.