Skip to content

fix(grid-row-reorder): update row insertion logic during drag-and-drop#3971

Open
viktorkombov wants to merge 1 commit into
vnextfrom
vkombov/fix-3969
Open

fix(grid-row-reorder): update row insertion logic during drag-and-drop#3971
viktorkombov wants to merge 1 commit into
vnextfrom
vkombov/fix-3969

Conversation

@viktorkombov

Copy link
Copy Markdown
Contributor

Closes #3969

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the Grid row reordering sample so dragged rows are reinserted into the bound data array after grid.deleteRow(...), addressing the issue where the dragged row disappears instead of being reordered (Issue #3969).

Changes:

  • Replaces in-place splice(...) insertion with a new-array assignment (slice(...).concat(...)) to ensure the grid detects the data update after a drop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 28 to +30
// remove the row that was dragged and place it onto its new location
this.grid.deleteRow(args.dragData.key);
this.data.splice(currRowIndex, 0, args.dragData.data);
this.data = this.data.slice(0, currRowIndex).concat(args.dragData.data, this.data.slice(currRowIndex));
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.

2 participants