-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix drag and drop reordering in collection blocks (#1344)
The implementation of `moveBlock` was flawed. Moving blocks by swapping only works if the move happens between directly adjacent blocks. However, there are scenarios where the move should be performed between non-adjacent blocks, for instance when a block is dragged outside the block list (see screencasts). To fix this, we change the implementation to move by removing the block at the `from` index and inserting it at the `to` index.
- Loading branch information
1 parent
9aa7aac
commit 031d86e
Showing
4 changed files
with
26 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/blocks-admin": patch | ||
--- | ||
|
||
Fix drag and drop reordering in collection blocks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters