svelte-dnd-action: SvelteKit support and breakage on the newest Svelte versions
Hi there,
Awesome package!
Though I understand SvelteKit is still beta, I thought I’d ask if there were any plans of adopting support.
Tested it out just now with SvelteKit v1.0.0-next.125
and it unfortunately appears very buggy with items vanishing, sticking, and stacking in weird ways. I didn’t see any explicit errors being thrown, so not sure what the underlying issue is.
To reproduce, I am just initializing a skeleton project with npm init svelte@next
and then replacing the contents of src/routes/index.svelte
with the provided Super basic, single list, no animation svelte-dnd-action example code.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 22 (13 by maintainers)
I think it works fine with Sapper. I wonder what the issue is. Will try to make time and have a look. Thx for letting me know
On Tue, Jul 13, 2021, 05:48 Ross @.***> wrote:
Alright, I created a bug for Svelte, including a REPL that reproduces it without using the library. It happens just by reordering a simple array. It started happening in v3.38.0, any version before should work fine. Here is the svelte issue: https://github.com/sveltejs/svelte/issues/6535
The workaround - use Svelte v3.37. or below. for now*
@SleepingRobot would be awesome if you could find which version of SvelteKit introduced this issue. If not, I will try to find time to do it soon.
I ran into this issue after performing a npm update which bumped my svelte to the latest version, v3.38.3 (svelte-dnd-action was at 0.5.3 at the time). After reinstalling svelte at v3.24.1, the issue is no longer present. The latest version of svelte-dnd-action also works with svelte@3.24.1 from what I can tell.
Here is a console error I get if I keep trying to drag items after one gets hidden:
Uncaught (in promise) DOMException: Failed to execute ‘insertBefore’ on ‘Node’: The node before which the new node is to be inserted is not a child of this node.
If I continue trying to drag things after that error, I will get this one:
Uncaught TypeError: Cannot read property ‘getBoundingClientRect’ of undefined at Pn (intersection.js:10) at pointerAction.js:271 at Vi (pointerAction.js:266)
Hopefully this helps