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: crash during third party drag and drop handling #3376

Closed
kalinkrustev opened this issue Sep 28, 2022 · 1 comment · Fixed by #3377
Closed

DataTable: crash during third party drag and drop handling #3376

kalinkrustev opened this issue Sep 28, 2022 · 1 comment · Fixed by #3377
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@kalinkrustev
Copy link
Contributor

Describe the bug

Drag and drop can potentially crash, when using third party helpers like React DnD, which attach handlers at top of DOM.

Reproducer

https://codesandbox.io/s/primereact-test-forked-p1ho5f

PrimeReact version

8.6.1

React version

18.x

Language

ALL

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  1. Open the reproducer URL
  2. Drag the first column "drag"
  3. Drop it on the second column "drop"
  4. Observe a crash with the error:
    Cannot read properties of null (reading 'style')

Note that that the reproducer is simplified version of what happens when using third party drag and drop handling.

Expected behavior

When columnReordering is not active, DataTable should not interfere with drag and drop events.

@kalinkrustev kalinkrustev 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 28, 2022
kalinkrustev added a commit to kalinkrustev/primereact that referenced this issue Sep 28, 2022
@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add 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 28, 2022
@melloware melloware added this to the 8.6.2 milestone Sep 28, 2022
@melloware
Copy link
Member

Agreed good fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants