bugfix: stopping event from bubbling up on item drag and drop

This commit is contained in:
2025-10-21 23:02:15 +02:00
parent 6c7fbdcde2
commit 1acf54f58a

View File

@@ -43,6 +43,13 @@
new_location_name = '';
}
function onDrop(ev, new_loc){
ev.preventDefault();
ev.stopPropagation();
move_dragged_to(new_loc);
return false;
}
async function onSet(new_location_name){
const data = {
name: new_location_name,
@@ -96,7 +103,7 @@
<li onclick={e => toggleChildren(e, location)}
class="{location.locations?'expanded':'collapsed'} {location.highlight?'highlight':null}"
ondragover={e => drag_over(e,location)}
ondrop={e => move_dragged_to(location)}
ondrop={e => onDrop(e,location)}
ondragleave={e => delete location.highlight}>
<span class="name">{location.name}</span>
{#if location.locations}