markuskoehler's avatar

Livewire breaks drag & drop

Hey guys

I am having a strange little problem.

I have implemented drag&drop behavior, which works just fine. But after emitting a Livewire event (I had tried Livewire.dispatch first, now I am trying with wire:submit) the handleDragStart event would not fire anymore when I am dragging elements.

Any clue what could be the reason?

Thanks!

0 likes
6 replies
markuskoehler's avatar

No, just the event does not trigger. After relading the page, events work again.

This also happens when switching the page via pagination, same behavior as when wire:submit

Udev's avatar

@markuskoehler I haven't used livewire so I'm not sure what the problem could be. Maybe its how the js is being loaded. Try the drag event with the console open to check for error, or create a click event to troubleshoot.

markuskoehler's avatar

@jaseofspades88 Sorry - I am not trying to reorder items. What I want to achieve is to drag & drop my bank account transactions onto categories to sort them in. This kinda works pretty well, just livewire breaks it every now and then and I dont know what to do about that, was thinking about $refresh or something, but apparently, I did not find a way to solve this

markuskoehler's avatar
markuskoehler
OP
Best Answer
Level 1

Found something - not the reason but a suitable fix. wire:key did not help to fix the lost dragstart event, but what helped was to call it from alpine via x-on:dragstart

Please or to participate in this conversation.