Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeNodeDrop property doesnt include enough information about drop location #16349

Open
zachsteffens opened this issue Sep 5, 2024 · 1 comment
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Milestone

Comments

@zachsteffens
Copy link

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

@zachsteffens zachsteffens added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 5, 2024
@mertsincan mertsincan added Resolution: Help Wanted Issue or pull request requires extra help and feedback and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 4, 2024
@mertsincan mertsincan added this to the Future milestone Dec 4, 2024
Copy link

github-actions bot commented Dec 4, 2024

Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨

@github-project-automation github-project-automation bot moved this to Review in PrimeNG Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Projects
Status: Review
Development

No branches or pull requests

2 participants