Skip to content

Commit

Permalink
Drag/Drop of nodes does not work any more
Browse files Browse the repository at this point in the history
Close #82
  • Loading branch information
mar10 committed Feb 17, 2024
1 parent aa27a20 commit 42b089c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ First release.
> This section will be removed after the beta phase. <br>
> 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.
Expand Down
15 changes: 10 additions & 5 deletions src/wb_ext_dnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,17 @@ export class DndExtension extends WunderbaumExtension<DndOptionsType> {
"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");
Expand Down

0 comments on commit 42b089c

Please sign in to comment.