Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changelog/20260519225000_i_20161.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
type: Fix
scope:
- ckeditor5-clipboard
closes:
- https://github.com/ckeditor/ckeditor5/issues/20161
---

External content dragged into the editor now keeps the copy drop effect instead of being treated as a move operation.
6 changes: 2 additions & 4 deletions packages/ckeditor5-clipboard/src/dragdrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,8 @@ export class DragDrop extends Plugin {
// is not possible until 'dragend' event case will be fixed.
if ( !this._draggedRange ) {
data.dataTransfer.dropEffect = 'copy';
}

// In Firefox it is already set and effect allowed remains the same as originally set.
if ( !env.isGecko ) {
} else if ( !env.isGecko ) {
// In Firefox it is already set and effect allowed remains the same as originally set.
if ( data.dataTransfer.effectAllowed == 'copy' ) {
data.dataTransfer.dropEffect = 'copy';
} else if ( [ 'all', 'copyMove' ].includes( data.dataTransfer.effectAllowed ) ) {
Expand Down
1 change: 1 addition & 0 deletions packages/ckeditor5-clipboard/tests/dragdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ describe( 'Drag and Drop', () => {
// Dragging.

targetPosition = model.createPositionAt( root.getChild( 0 ), 5 );
dataTransferMock.effectAllowed = 'copyMove';
fireDragging( dataTransferMock, targetPosition );
clock.tick( 100 );

Expand Down