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

Tree DragDrop doesn't allow drag and drop between nodes #2177

Closed
adamerose opened this issue Jul 9, 2021 · 4 comments
Closed

Tree DragDrop doesn't allow drag and drop between nodes #2177

adamerose opened this issue Jul 9, 2021 · 4 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@adamerose
Copy link

[X] bug report
[ ] feature request
[ ] support request

PrimeReact Tree doesn't allow dropping between nodes. It works properly in PrimeNg as shown below:

image

Ng Working:
https://stackblitz.com/edit/primeng-treedragdrop-demo

React Not working:
https://codesandbox.io/s/8fq43

primeflex 2.0.0
primeicons 4.1.0
primereact 6.4.1
react 17.0.2
react-dom 17.0.2
react-transition-group 4.4.2
@adamerose adamerose changed the title Tree DragDrop doesn't allow dropping between nodes Tree DragDrop doesn't allow drag and drop between nodes Nov 1, 2021
@zamanapavel
Copy link

zamanapavel commented Nov 3, 2021

temporary solution:
add height to p-treenode-droppoint class.
and some background-color to .p-treenode-droppoint-active
currently height is 0 so you cannot hover on proper element to drop

@adamerose
Copy link
Author

temporary solution: add height to p-treenode-droppoint class. and some background-color to .p-treenode-droppoint-active currently height is 0 so you cannot hover on proper element to drop

Awesome didn't realize it was just a styling problem. Here's a sandbox of the fix for anyone interested: https://codesandbox.io/s/busy-payne-cdk7i?file=/index.css:3300-3460

Added @zamanapavel's two lines plus a background color on hover and I think it works the same as PrimeNG now.

.p-treenode-droppoint {
  height: 4px;
}

.p-treenode-dragover {
  background-color: #e9ecef;
}

.p-treenode-droppoint-active {
  background-color: #a6d5fa;
}

Can see more styling here, but I was happy with just the 3 above.
https://github.com/primefaces/primeng/blob/2444986ee9e47dc4a502ef0b1eaf2e87d51ad3e7/src/app/components/tree/tree.css
https://github.com/primefaces/primeng/blob/ca40b1340511b9437726000b33fa4d407af6d926/src/assets/components/themes/nova/theme.css

@Alexei-Ruksha
Copy link

Alexei-Ruksha commented Nov 5, 2021

Hi @mertsincan
could also please take a look at the commit c5cf0c5? There are a lot of changes in Tree.css so it might some other issues can be solved by reviewing that commit.

Thank you in advance,
Alexei

@mertsincan mertsincan self-assigned this Nov 5, 2021
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Nov 5, 2021
@mertsincan mertsincan added this to the 7.0.0.Final milestone Nov 5, 2021
@mertsincan
Copy link
Member

Hi,
Thanks a lot! Fixed now!

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

4 participants