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

UITreeNode: onDropPoint should execute even when props.node.droppable === false. #6976

Closed
rpiaggio opened this issue Aug 2, 2024 · 1 comment · Fixed by #6988 or #7005
Closed

UITreeNode: onDropPoint should execute even when props.node.droppable === false. #6976

rpiaggio opened this issue Aug 2, 2024 · 1 comment · Fixed by #6988 or #7005
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@rpiaggio
Copy link
Contributor

rpiaggio commented Aug 2, 2024

Describe the bug

When there's a node with droppable: false, the drop point before said node will render and be active (which is correct), but if you drop another node on said drop point, it will not call onDragDrop and the drop point will remain active (both of which are incorrect).

Simply removing line

if (props.node.droppable !== false) {
(and 624 closing the bracket) will fix the bug.

Reproducer

No response

System Information

System:
OS: macOS 14.6
CPU: (16) arm64 Apple M3 Max
Memory: 338.42 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.9.0 - /nix/store/wz7pf9yhmby97729pmgyrlxvyfpds16y-devshell-dir/bin/node
Yarn: 1.22.19 - /nix/store/wz7pf9yhmby97729pmgyrlxvyfpds16y-devshell-dir/bin/yarn
npm: 8.19.1 - /nix/store/wz7pf9yhmby97729pmgyrlxvyfpds16y-devshell-dir/bin/npm
Browsers:
Chrome: 127.0.6533.89
Safari: 17.6
npmPackages:
primereact: ~10.7.0 => 10.7.0
react: 18.3.1 => 18.3.1

Steps to reproduce the behavior

Have a Tree with at least 2 TreeNodes, one of which has droppable: false. Try to drop another node into the drop point just before the node with droppable: false. The Tree's onDragDrop will not fire and the drop point will remain active even when the mouse button is released.

Expected behavior

I would have expected to be able to drop nodes before a node with droppable: false, even if dropping into it is disabled.

@rpiaggio rpiaggio added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 2, 2024
@melloware
Copy link
Member

@rpiaggio can you submit a Pr with your proposed fix?

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 3, 2024
@melloware melloware added this to the 10.8.2 milestone Aug 5, 2024
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
2 participants