Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kevinbevers opened this issue Jan 16, 2021 · 2 comments
Open

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

kevinbevers opened this issue Jan 16, 2021 · 2 comments

Comments

@kevinbevers
Copy link

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.

@Norserium
Copy link

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.

@kevinbevers
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants