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

Question - Sortable and Snappable #606

Open
robertrachita opened this issue Apr 11, 2024 · 0 comments
Open

Question - Sortable and Snappable #606

robertrachita opened this issue Apr 11, 2024 · 0 comments

Comments

@robertrachita
Copy link

robertrachita commented Apr 11, 2024

I'd like to have two containers, one being a Sortable, and the other one being a grid Snappable(swappable). What I'm trying to achieve is having elements from the Sortable container dragged onto the Snappable grid.

If I declare them separately like this:

`const sortable = new Sortable(document.querySelectorAll('.draggable-container'), {
draggable: '.draggable-element',
});

	const swappable = new Swappable(document.querySelectorAll('.grid-container'), {
		draggable: '.grid-cell',
		plugins: [Plugins.Snappable],
	});`

i am not able to drag any elements between the two.

The only method I've managed to get something like this to work is by having two sortables declared at the same time, like in the Multiple containers example, but this is not what I want as I'd like to preferably keep the snappable/swapping features, and I also want to basically duplicate/create a new copy on the element from the Sortable container onto the Swappable element.

Is this even possible? If so, any examples of how I can achieve this would be welcomed.

  • Library version: 1.1.3
  • Browsers: all
  • Tech stack: TypeScript v5.4.
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

1 participant