From ca164dca03434d3fd04c2dd07afce41d0e58a65f Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Mon, 11 May 2026 12:28:05 -0400 Subject: [PATCH] fix(ui/templates): stop drop propagation on folder nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without stopPropagation, dropping a template onto a folder fires both OnDrop(folder) and OnDropOnRoot via event bubbling. The two async handlers race on the same scoped DbContext, which is not thread-safe — the second throws ObjectDisposedException and tears down the Blazor circuit. Surfaced during browser smoke testing via JS-dispatched DragEvent sequence. --- .../Components/Pages/Design/Templates.razor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ScadaLink.CentralUI/Components/Pages/Design/Templates.razor b/src/ScadaLink.CentralUI/Components/Pages/Design/Templates.razor index 4a30f00..061e475 100644 --- a/src/ScadaLink.CentralUI/Components/Pages/Design/Templates.razor +++ b/src/ScadaLink.CentralUI/Components/Pages/Design/Templates.razor @@ -534,7 +534,8 @@ @ondragenter="() => OnDragEnter(node)" @ondragleave="() => OnDragLeave(node)" @ondragover:preventDefault="@isDropTarget" - @ondrop="() => OnDrop(node)"> + @ondrop="() => OnDrop(node)" + @ondrop:stopPropagation="true"> @switch (node.Kind) { case TmplNodeKind.Folder: