From 42b089c069e5843d21bc1ffeea38071847d1ad45 Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Sat, 17 Feb 2024 08:31:33 +0100 Subject: [PATCH] Drag/Drop of nodes does not work any more Close #82 --- CHANGELOG.md | 2 ++ src/wb_ext_dnd.ts | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4af2044..62af363a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ First release. > This section will be removed after the beta phase.
> Note that semantic versioning rules are not strictly followed during this phase. +- v0.8.2: Fix #82: Drag/Drop of nodes does not work any more. + - v0.8.1: Distinguish between `.log()` and `.logDebug()`, which now call `console.log()` and `console.debug()` respectively. - v0.8.1: Fix #72: DragEnter event does not provide the source node, only the target. diff --git a/src/wb_ext_dnd.ts b/src/wb_ext_dnd.ts index 32dd71ec..96d82074 100644 --- a/src/wb_ext_dnd.ts +++ b/src/wb_ext_dnd.ts @@ -420,12 +420,17 @@ export class DndExtension extends WunderbaumExtension { "preventRecursion" ) || // Prevent dropping nodes under same direct parent: - (dndOpts.preventSameParent && - srcNode && - targetNode.parent === srcNode.parent, - "preventSameParent") || + _t( + dndOpts.preventSameParent && + srcNode && + targetNode.parent === srcNode.parent, + "preventSameParent" + ) || // Don't allow void operation ('drop on self'): TODO: should be checked on move only - (dndOpts.preventVoidMoves && targetNode === srcNode) + _t( + dndOpts.preventVoidMoves && targetNode === srcNode, + "preventVoidMoves" + ) ) { dt.dropEffect = "none"; // this.tree.log("Prevented drop operation");