Skip to content

fix: clear resize indicator and reset state on data update #4120#5082

Open
Erica-cod wants to merge 3 commits intoVisActor:developfrom
Erica-cod:fix/resize-col-line-stuck-4120-v2
Open

fix: clear resize indicator and reset state on data update #4120#5082
Erica-cod wants to merge 3 commits intoVisActor:developfrom
Erica-cod:fix/resize-col-line-stuck-4120-v2

Conversation

@Erica-cod
Copy link
Copy Markdown

@Erica-cod Erica-cod commented Mar 30, 2026

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Update dependency
  • Code style optimization
  • Test Case
  • Branch merge
  • Site / documentation update
  • Demo update
  • Workflow
  • Chore
  • Release
  • Other (about what?)

🔗 Related issue link

close #4120

💡 Background and solution

When a user is dragging to resize a column/row, if external code calls setRecords() or updateOption() at the same time, the resize indicator line gets stuck on the table and the table becomes unresponsive (stuck in grabing interaction state).

Root cause: _updateOptionSetState() resets columnResize/rowResize state objects but never calls hideResizeCol()/hideResizeRow() to remove the visual indicator. After the reset, the pointerup handler sees resizing === false and skips endResizeCol(), leaving the indicator line visible and the interaction state stuck.

Solution:

  1. Added endResizeIfResizing() method to StateManager — a focused method that hides resize indicators, resets the resizing flag, and restores interactionState from grabing to default.
  2. _updateOptionSetState() now calls endResizeIfResizing() internally, so updateOption() also benefits.
  3. setRecords() in ListTable, PivotTable, and PivotChart calls endResizeIfResizing() directly — a minimal, targeted cleanup without the full state reset of updateOptionSetState().

Demo: Added resize-setRecords example under "交互" category with buttons to trigger setRecords() and updateOption() during resize operations.

📝 Changelog

Language Changelog
🇺🇸 English fix: clear resize indicator and reset interaction state when setRecords/updateOption is called during resizing by using function endResizeIfResizing, also add demo case
🇨🇳 Chinese 修复:在列宽/行高调整过程中调用 setRecords 或 updateOption 时,使用抽离方法endResizeIfResizing重置交互状态,避免指示线残留和表格卡死,并且添加demo case

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

…e indicators VisActor#4120

When setRecords() or updateOption() is called during an active resize
operation, call updateOptionSetState() to fully reset interaction state,
hide resize column/row indicators, and prevent the table from being
stuck in grabing mode. Added demo case for verification.

Made-with: Cursor
… setRecords

Instead of calling the heavy updateOptionSetState() from setRecords(),
extract a focused endResizeIfResizing() method that only handles resize
indicator cleanup. _updateOptionSetState() reuses it internally.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

如果列宽正在调整中,没有结束,此时records更新,会导致列宽调整的线卡在表格上消失不了,如何解决

1 participant