Skip to content

fix: delete reverse-selected rows correctly#5225

Open
biubiukam wants to merge 2 commits into
VisActor:developfrom
biubiukam:fix/issue-5214-delete-selected-rows
Open

fix: delete reverse-selected rows correctly#5225
biubiukam wants to merge 2 commits into
VisActor:developfrom
biubiukam:fix/issue-5214-delete-selected-rows

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

Fixes #5214

💡 Background and solution

VTable Sheet keeps the original drag direction in row selection ranges. When rows are selected from bottom to top, the range has a larger start row than end row.

The context-menu flow previously assumed ascending row ranges in two places:

  • Right-clicking inside a reverse-dragged selection was treated as clicking outside it, so the selection could collapse to one row.
  • The delete handler iterated directly from the start row to the end row, so a reverse range was not fully deleted.

This change normalizes the row boundaries before checking whether the right-clicked row belongs to the selection and before collecting rows to delete. A regression test covers reverse row selection, right-click preservation, and batch deletion with VTable Sheet's record synchronization mode.

Validation:

  • @visactor/vtable-plugins TypeScript compilation
  • @visactor/vtable-plugins: 8 suites, 58 tests
  • Pre-push package suite:
    • @visactor/vtable-sheet: 76 suites, 442 tests
    • @visactor/vtable: 52 suites, 223 tests
    • Related Gantt and Vue package tests

📝 Changelog

Language Changelog
🇺🇸 English Fix deleting rows selected by dragging upward in VTable Sheet.
🇨🇳 Chinese 修复 VTable Sheet 从下向上拖选多行后右键删除不正确的问题。

☑️ Self-Check before Merge

  • 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

@github-actions github-actions Bot added the chore label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]

1 participant