dnd-kit icon indicating copy to clipboard operation
dnd-kit copied to clipboard

Not working in Firefox add-on popup window.

Open vanishcode opened this issue 3 years ago • 7 comments

Hey, guys, I am a Chrome Extension/Firefox Addon developer. I found it does not work in the Firefox addon popup window, but it works in debug tab window and split window. And HTML5 origin drag and drop runs ok.

here is my demo: https://github.com/vanishcode/firefox-addon-test

screenshot: https://user-images.githubusercontent.com/20496444/220562746-01f7398c-70f9-44e0-ba06-9ac2900e14b7.mov

update: On the Chrome extension popup window, the 'end' event would be triggered, but in this Firefox case, 'cancel' would be triggered.

Thanks!


I fixed it: in the Firefox addon popup window, the code below will be triggered:

https://github.com/clauderic/dnd-kit/blob/f3ad20d5b2c2f2ca7b82c193c9af5eef38c5ce11/packages/core/src/sensors/pointer/AbstractPointerSensor.ts#L105


Thanks also!

vanishcode avatar Feb 22 '23 08:02 vanishcode

@vanishcode I'm having the exact same issue! What did you do to resolve it ? I can see you've referenced a line in a file.

JoeDruryVS avatar Apr 03 '23 10:04 JoeDruryVS

@vanishcode I'm having the exact same issue! What did you do to resolve it ? I can see you've referenced a line in a file.

just comment out this line of code(production js, not ts sourcecode), or delete it and use patch-package(https://www.npmjs.com/package/patch-package).

vanishcode avatar Apr 03 '23 14:04 vanishcode

Thanks for clarifiying! I'm using https://docs.dndkit.com/presets/sortable and that path doesn't exist for me in my node_modules folder :(

JoeDruryVS avatar Apr 03 '23 15:04 JoeDruryVS

@dnd-kit\core\dist\core.esm.js

Added your change here and that works! Thanks

JoeDruryVS avatar Apr 03 '23 15:04 JoeDruryVS

Thank you @vanishcode and @JoeDruryVS - removing the line works! Happy to open a PR with this change but afraid I will break something I am unaware of.

Since the issue is still there - could we reopen @clauderic?

piotrjanosz avatar May 10 '23 20:05 piotrjanosz

Running into this as well for https://github.com/ayoung19/clipboard-history.

ayoung19 avatar Dec 27 '24 22:12 ayoung19

I ran into this issue myself, and the patch-package approach works well for now (thanks @vanishcode).

I've also just made the change to hopefully make this fix upstream: https://github.com/clauderic/dnd-kit/pull/1808

tylerccarson avatar Oct 01 '25 17:10 tylerccarson