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

DataTable incorrectly indicates drop functionality for unrelated draggable elements #7239

Closed
kttmv opened this issue Sep 24, 2024 · 1 comment · Fixed by #7241
Closed

DataTable incorrectly indicates drop functionality for unrelated draggable elements #7239

kttmv opened this issue Sep 24, 2024 · 1 comment · Fixed by #7241
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@kttmv
Copy link
Contributor

kttmv commented Sep 24, 2024

Describe the bug

The DataTable component incorrectly indicates drop functionality when any draggable element is hovered over its rows, even if drop actions are not supported. The cursor changes to indicate that a drop is possible, even though dropping on a row doesn't actually perform any action unless it's specifically for reordering rows within the same DataTable.

Reproducer

No response

System Information

System:
    OS: Windows 10 10.0.19045
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13800H
    Memory: 15.57 GB / 31.66 GB
  Binaries:
    Node: 20.15.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.6.0 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    react: 18.3.1 => 18.3.1

Steps to reproduce the behavior

  1. Navigate to the DataTable page
  2. Find any draggable element on the page. For example this can be:
    • A link (e.g., the PrimeReact logo or the Github link in the top-right corner of the page)
    • An image
    • Selected text
    • A row from another DataTable
    • A row from the same DataTable when reordering is disabled for that table
  3. Click and drag the chosen element.
  4. Hover the dragged element over any row in the DataTable.

Result: The cursor changes to indicate a possible drop action (a cursor that indicates "copy" appears).

chrome_UHw5IS8HF9.mp4

Expected behavior

The DataTable should only indicate drop functionality in specific scenarios:

  1. For DataTables with row reordering enabled:
    • The cursor should only change when dragging a row from the same DataTable.
    • It should not react to other draggable elements from outside the DataTable.
  2. For DataTables without row reordering functionality:
    • The cursor should not change at all when any element (including its own rows) is dragged over it.
@kttmv kttmv 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 24, 2024
@melloware
Copy link
Member

I think its related to this: #7200

kttmv pushed a commit to kttmv/primereact that referenced this issue Sep 24, 2024
kttmv pushed a commit to kttmv/primereact that referenced this issue Sep 24, 2024
@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 Sep 24, 2024
@melloware melloware added this to the 10.8.4 milestone Sep 24, 2024
melloware pushed a commit that referenced this issue Sep 24, 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
Development

Successfully merging a pull request may close this issue.

2 participants