react-sortablejs icon indicating copy to clipboard operation
react-sortablejs copied to clipboard

[bug] Doesn't work with Sortablejs 1.13.0 or 1.10.2

Open kevinbevers opened this issue 4 years ago • 2 comments

This package doesn't function properly when one of these to versions is installed with it. In specific the swap doesn't work. The only way it works if version 1.12.0 is installed. Since 1.12.0 is deprecated on a fresh install the swap and the drag & drop doesn't function as it should.

kevinbevers avatar Jan 16 '21 23:01 kevinbevers

I figured out, that in sortable.esm.js (it is used by Webpack bundler because it's written in module section) Swap plugin is not mounted.

So you have to add the following string in some of your index files:

import Sortable, { Swap } from 'sortablejs';

Sortable.mount(new Swap());

It doesn't solve all issues, but may be helpful.

Norserium avatar Jan 21 '21 22:01 Norserium

I figured out, that in sortable.esm.js (it is used by Webpack bundler because it's written in module section) Swap plugin is not mounted.

So you have to add the following string in some of your index files:

import Sortable, { Swap } from 'sortablejs';

Sortable.mount(new Swap());

It doesn't solve all issues, but may be helpful.

Ah, so thats why it doesnt work with the newer version or the older one. Unfortunately mounting doesn’t work for my usecase. I run next and i get webpack module error when i try to mount Swap. I worked around my issue by using yarn and installing v1.12. Alternatively a package lock with v1.12

kevinbevers avatar Jan 23 '21 00:01 kevinbevers