isaacHagoel / svelte-dnd-action

An action based drag and drop container for Svelte
MIT License
1.8k stars 104 forks source link

Accordion based on svelte dnd action generic component example - dragndrop hanging #363

Open 99bits opened 2 years ago

99bits commented 2 years ago

Hi Isaac,

I am trying to make an accordion from your example and it's working but experiencing some very strange behaviours. Perhaps you can have a look to see. It seems that the drag and drop is getting stuck and sometimes hanging the browser.

Cheers,

https://svelte.dev/repl/1f3437021e76495e83746200ed002096?version=3.46.4

isaacHagoel commented 2 years ago

it is indeed strange. my guess is that this component tries to add/remove elements during drag. what is the expected behaviour here? what is this accordion supposed to be doing?

99bits commented 2 years ago

Hi Isaac, Thanks for having a look into this. In Repl, I changed the names to Accordion and Subaccordion.

Desired Behaviour:

  1. Accordions can be reordered with dragndrop.

  2. Accordions cannot be dragndrop into subaccordions.

  3. Subaccordions can be reordered within same parent Accordion.

  4. Subaccordions can be dragndrop into other parent Accordions.

  5. When a subaccordion is dragndrop into other parent Accordions, it will be added to the new parent Accordion and removed from the accordion where it came from.

99bits commented 2 years ago

I believe that is a bug because while holding the dragndrop, the browser hangs.

99bits commented 2 years ago

Hi Isaac,

Would you have some time to look into this Issue?

99bits commented 2 years ago

I just tried the new version and still the same problems.