Skip to content

State not updating until after item is dropped #654

@williamcaseylucas

Description

@williamcaseylucas

Hi,

I'm running into two small issues:

1. State is not updating until after item is dropped

I'm trying to update the opened state so that the card collapses while I'm in the middle of dragging, but this only is reflected after I drop the card. Is there a way to leverage onMount or $effect to accomplish this? The swapy library was somewhat buggy when I tried it, but the logic they used for $effect and onMount allowed me to accomplish this desired UI update. I would love to have the same functionality here! (link to swapy example https://github.com/TahaSh/swapy/blob/main/examples/svelte-dynamic/App.svelte)

2. When item is expanded and dragged, it shifts slightly down

When I click and hold on the handle when my content is expanded, it shifts slightly down from where my cursor was. (This doesn't happen when I click and drag when the item is collapsed). Is there a way to adjust this?

Playground link

I've included a link to a playground to demonstrate my current experience (please toggle tailwind to see it correctly) https://svelte.dev/playground/6dd35481d2184d618a2c7957e82b8f5f?version=5.25.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions