tarb / svelte-dnd-list

Simple and lightweight Svelte Drag and Drop library
MIT License
47 stars 4 forks source link

Svelte 5 support? #8

Open kristianmandrup opened 1 month ago

kristianmandrup commented 1 month ago

Hi,

Your library looks promising. Like someone else mentioned, it was not clear if the code for the examples was available but I found the answer via a closed issue and have now downloaded the full library to take a peek.

I will try to use the library in a SvelteKit 2 app using Svelte 5. On install I get a peer dependencies warning. Have you or anyone else made it work with Svelte 5? If so, let's perhaps add it to the list of allowed peers?

"^3.19.0 || ^4.0.0 || ^5.0.0"

dependencies:
+ svelte-dnd-list 0.1.8

 WARN  Issues with peer dependencies found
.
└─┬ @sveltejs/vite-plugin-svelte 3.1.1
  └─┬ svelte-hmr 0.16.0
    └── ✕ unmet peer svelte@"^3.19.0 || ^4.0.0": found 5.0.0-next.199
kristianmandrup commented 1 month ago

Btw, in the Programmatic example, there seemed to be an error:

        // place
        if (to.dropZoneID === 'a') {
            colors1 = [...colors1];
            colors1.splice(to.index, 0, moving);
        } else if (to.dropZoneID === 'b') {
            colors2 = [...colors2];
            colors2.splice(to.index, 0, moving);
        }

The splice function only takes 2 arguments, so the moving argument is invalid.