TreeNodeDrop property doesnt include enough information about drop location #16349
Labels
Resolution: Help Wanted
Issue or pull request requires extra help and feedback
Milestone
Describe the bug
When dragging and dropping, if I'm trying to drop an item at the root level, the drop location listed in the event is the last node in the tree as opposed to undefined or null. This is insufficient for scenarios where validateDrop is used. I've created a stackblitz here that demonstrates this issue.
In this demo scenario I'm limiting drops to parents that are marked as folder:true. I am unable to drop an item at the root level below the taxes.xslx tree item because when onJobTreeNodeDrop is fired, the drop node property is taxes.xslx which is not a folder. There is no way for me to determine that the drop has taken place at the root level(no parent) as opposed to last child of the root (dropping onto a tree item instead of a drop slot). It's obvious that the control knows the difference because it adjusts the tree accordingly, but the data required for making this determination in the drop handler is not passed in via the TreeNodeDropEvent property.
Environment
Angular: 17
Primeng: 17.18.0
Reproducer
https://stackblitz.com/edit/primeng-treedragdrop-demo-jqwcvn?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html,src%2Fassets%2Ffiles.json
Angular version
17.0.9
PrimeNG version
17.18.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.14.0
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: