From 1acf54f58a8b07a2b1ab9b05dcc32cc7b00a9915 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Tue, 21 Oct 2025 23:02:15 +0200 Subject: [PATCH] bugfix: stopping event from bubbling up on item drag and drop --- frontend/src/routes/stock/Locations.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/stock/Locations.svelte b/frontend/src/routes/stock/Locations.svelte index 8a32edf..3dea134 100644 --- a/frontend/src/routes/stock/Locations.svelte +++ b/frontend/src/routes/stock/Locations.svelte @@ -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 @@
  • 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}> {location.name} {#if location.locations}