Skip to content

fix: prevent page scroll after canceling table rotation - #5236

Merged
fangsmile merged 1 commit into
VisActor:developfrom
biubiukam:fix/issue-5235-rotate-wheel
Jul 27, 2026
Merged

fix: prevent page scroll after canceling table rotation#5236
fangsmile merged 1 commit into
VisActor:developfrom
biubiukam:fix/issue-5235-rotate-wheel

Conversation

@biubiukam

Copy link
Copy Markdown
Contributor

🤔 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

fix #5235

💡 Background and solution

After RotateTablePlugin rotated and restored a table, scrolling inside the table could also scroll the surrounding page.

When rotation was canceled, cancelTransform registered a translated matrix with the global event transformer. Because the matrix was not an identity matrix, VRender cloned the native WheelEvent. Calling preventDefault() on the transformed event therefore did not cancel the original browser event.

This change removes the residual translation when canceling rotation so the transformer receives an identity matrix and preserves the native wheel event. It also adds a regression test that verifies preventDefault() remains connected to the original event after restoring the table.

Validation:

  • @visactor/vtable-plugins: 10 test suites and 60 tests passed.
  • TypeScript compilation passed.
  • rush build -t @visactor/vtable-plugins completed successfully with existing build warnings.
  • The repository pre-push suite passed for the changed plugin package. It still reports two assertions in packages/vtable-sheet/__tests__/nested-formula-engine.test.ts; this pull request does not modify packages/vtable-sheet.

📝 Changelog

Language Changelog
🇺🇸 English Prevent page scrolling when using the mouse wheel after restoring a rotated table.
🇨🇳 Chinese 修复表格旋转还原后,在表格内滚动鼠标滚轮时页面也会滚动的问题。

☑️ 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

@fangsmile
fangsmile merged commit 69fe924 into VisActor:develop Jul 27, 2026
2 checks passed
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.

[Bug] 表格旋转插件RotateTablePlugin,在旋转并还原后,滚动表格时整个页面也滚动了

2 participants