[p-tree] event.accept() not available on first drop #10093
Labels
LTS-FIXED-9.2.6
Fixed in PrimeNG LTS 9.2.6
LTS-FIXED-10.1.1
Fixed in PrimeNG LTS 10.1.1
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Thank you for the fix of #9991 with the release of 11.3.2. However, we're blocked by a related issue:
Even though, the event is now triggered. The first fire of the event doesn't have an
accept()
method. Thus our current implementation's attempt to utilize that method throws an error.I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
https://stackblitz.com/edit/primeng-treedragdrop-demo-4bbf54?file=src%2Fapp%2Fapp.component.ts
Current behavior
accept()
method is not present the first time we drop the item. (It is there the second time we drop the item.)Expected behavior
event.accept()
is present on the event on the first drop.event.accept()
method, the dropped node does not leave the source and get added to the target.Minimal reproduction of the problem with instructions
See stackblitz and gif above
What is the motivation / use case for changing the behavior?
We need to:
a. validate the note and NOT
accept()
if criteria aren't metb. copy and restore the dragged item in the source list before
accept()
c. change the
type
of the dropped nodePlease tell us about your environment:
Windows 10, Visual Studio Code, NPM 7.9
Language: TypeScript 4.0.5
Node (for AoT issues):
node --version
= 14.15.3The text was updated successfully, but these errors were encountered: