ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Images getting duplicated when clicking and/or dragging-and-dropping quickly

Open Sanderovich opened this issue 1 year ago • 5 comments

📝 Provide detailed reproduction steps (if any)

  1. Open a CKEditor demo page (https://ckeditor.com/ckeditor-5/demo/feature-rich/).
  2. Insert an image.
  3. Start clicking and/or drag-and-dropping the image really fast.

https://github.com/user-attachments/assets/c336e9c2-545c-4a7a-b8a6-6fc282d4c563

✔️ Expected result

Nothing happens.

❌ Actual result

Image gets duplicated.

📃 Other details

  • Browser: Firefox version 129.x
  • OS: Windows

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

Sanderovich avatar Aug 16 '24 13:08 Sanderovich

Thanks for the issue, I cannot reproduce on FF + Mac, @ckeditor/qa-team could you check?

Witoso avatar Aug 19 '24 13:08 Witoso

I was able to reproduce it on the docs demo and on all-features manual test as well:

Uncaught TypeError: this._native is null
    get isCanceled datatransfer.ts:113
    _setupDragging dragdrop.ts:314
    fire emittermixin.ts:241
    fireListenerFor bubblingemittermixin.ts:207
    fire bubblingemittermixin.ts:118
    fire domeventobserver.ts:100
    onDomEvent clipboardobserver.ts:98
    observe domeventobserver.ts:76
    fire emittermixin.ts:241
    domListener emittermixin.ts:340
    attach emittermixin.ts:270
    _addEventListener emittermixin.ts:314
    addEventListener emittermixin.ts:894
    listenTo emittermixin.ts:162
    listenTo emittermixin.ts:115
    listenTo emittermixin.ts:112
    observe domeventobserver.ts:74
    observe domeventobserver.ts:73
    attachDomRoot view.ts:317
    init classiceditorui.ts:107
    create classiceditor.ts:194
    promise callback*__webpack_modules__</create/< classiceditor.ts:194
    create classiceditor.ts:191

You need to move the mouse just a bit while clicking very fast.

FilipTokarski avatar Aug 21 '24 11:08 FilipTokarski

@FilipTokarski Firefox or everywhere?

Witoso avatar Aug 21 '24 11:08 Witoso

Just Firefox. Chrome and Safari seem to be fine.

FilipTokarski avatar Aug 21 '24 12:08 FilipTokarski

I can also confirm that I was able to reproduce the issue only on Firefox

kubaklatt avatar Oct 18 '24 11:10 kubaklatt

@kubaklatt Can you check if the issue still happens on Firefox 131? I'm trying to reproduce it but haven't been able to.

Mati365 avatar Oct 28 '24 06:10 Mati365

@Mati365 Yes, the problem still occurs on Firefox 131 - you have to click quickly while moving the mouse

Expected behavior on Chrome:

https://github.com/user-attachments/assets/6ed3520a-fb57-46e3-adc4-1ed3dbc07b09

Actual behavior on Firefox:

https://github.com/user-attachments/assets/7e99ee49-3346-44b0-afa5-9fc458262c4d

kubaklatt avatar Oct 28 '24 16:10 kubaklatt

I managed to reproduce that on Chrome with CPU 20x Slowdown. Looks like race condition between selection and clipboard.

Mati365 avatar Oct 29 '24 13:10 Mati365