Repository navigation
feat: 给表格增加一个配置项 - #5335
feat: 给表格增加一个配置项#5335rubbishmaker wants to merge 6 commits into
Conversation
|
有两处阻塞性问题需要修正后再合并:
|
- Clamp column width by the target value's out-of-bounds direction so non-realtime mode no longer reverse-resizes to the far min/max boundary when the whole pending delta is applied at once. - Stop double-subtracting the accumulated delta on the adaptive neighbor column/row, keeping the final size consistent with the indicator line and realtime mode. - Add deterministic regression cases for non-realtime min clamp and adaptive neighbor column/row resize. - Mount the resize-realtime example toggle inside the table root element so it no longer leaks onto other demos.
| const colBaseX = getColX(col, this.table, isRightFrozen); | ||
| const delta = previewDeltaX ?? 0; | ||
| // 非实时响应模式下指示线基于当前列右边界+累计偏移量渲染 | ||
| const colX = isRightFrozen ? colBaseX - delta : colBaseX + delta; |
There was a problem hiding this comment.
[P2] 非实时拖拽预览应按最终尺寸约束指示线
当 resize.realtime=false 且拖拽越过 minWidth/maxWidth(或 adaptive 模式下相邻列的最小宽度)时,这里直接用未约束的 pendingDeltaX 移动指示线,标签也显示未约束的宽度;松手后 applyColumnResizeDelta 才执行约束。例如列宽 180、minWidth=100,左拖 100px,指示线和标签预览 80px,最终列宽却是 100px,松开时边界跳回 20px。行高预览的 pendingDeltaY 与 limitMinHeight 同样存在此问题。建议在绘制预览时复用与提交相同的有效位移计算,使指示线和标签对应最终可应用的尺寸。这不同于已有讨论中提交时反向 clamp 或 adaptive 位移重复扣减:即使最终尺寸计算正确,预览仍会失真。
In non-realtime resize mode the indicator line and label previewed the raw unconstrained pendingDelta, so dragging past min/max (or an adaptive neighbor limit) showed a size that jumped on mouse up. Reuse the same effective-delta computation as commit via a dry-run path so the preview matches the final size. Add a deterministic visual regression case for the column preview clamp.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
#4809
💡 Background and solution
📝 Changelog
增加一个配置项realtime,用于控制表格的resize行为。默认为true,与当前行为保持一致,为false时不会实时渲染,拖拽中 :只累积偏移量
pendingDelta+ 移动指示线,不重排列宽/行高,松开时 :一次性把累计偏移应用到真实列宽/行高| ---------- | --------- |
| 🇺🇸 English | |
| 🇨🇳 Chinese | |
☑️ Self-Check before Merge
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough