p-tree unable to drag to root

UI Components for Angular
Post Reply
WeaponX
Posts: 1
Joined: 16 Nov 2022, 11:37

16 Nov 2022, 11:40

When I console log the dropped and dragged node from event onDrop the dropped element is always the closest node and never undefined or null as it should be when dragging to root of the tree.

See stackblitz example made from official blitz and added onDrop method.
https://stackblitz.com/edit/primeng-tre ... mponent.ts

How can I see if the node is dropped on the tree root?

Ernio
Posts: 4
Joined: 17 Dec 2019, 13:16

14 Dec 2022, 09:02

Same issue.

Has anyone found solution?

event.index is always equal to that of event.dropNode, no matter if we drop into it, or above it (next to).

For this reason validating is impossible because we can't differentiate between the 2 operations.

IMO: event.index should be undefined when dropping into something.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 37 guests