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

When I quickly move an item from one column to another empty column, the item gets deleted from the list. #1363

Open
manas-anarov opened this issue Mar 14, 2024 · 3 comments

Comments

@manas-anarov
Copy link

manas-anarov commented Mar 14, 2024

If the column is not empty, there are no errors.

code:
https://codesandbox.io/p/sandbox/github/zcahsja/Multi-Drag-Kanban/

{
  "name": "dnd-kit-multi-select-kanban",
  "version": "1.0.0
```",
  "description": "",
  "keywords": [],
  "main": "src/index.tsx",
  "dependencies": {
    "@dnd-kit/core": "6.0.8",
    "@dnd-kit/sortable": "7.0.2",
    "@emotion/react": "11.10.6",
    "@emotion/styled": "11.10.6",
    "@mui/icons-material": "5.11.11",
    "@mui/material": "5.11.15",
    "classnames": "2.3.2",
    "loader-utils": "3.2.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-scripts": "5.0.1"
  },
  "devDependencies": {
    "@types/react": "18.0.25",
    "@types/react-dom": "18.0.9",
    "typescript": "4.4.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

video:
https://github.com/clauderic/dnd-kit/assets/9741780/e07fae96-c487-4600-bd72-c7ad2e560fe9

@ehrro
Copy link

ehrro commented Apr 3, 2024

I had the same kind of issues and the reason is that you are missing a case scenario in your dragOver or dragEnd functions. To find the issue you need to console log over active and over and see what's happening when you do a quick drag. It's tricky to make it right especially when you have 2 levels of drag and drop.

@manas-anarov
Copy link
Author

I had the same kind of issues and the reason is that you are missing a case scenario in your dragOver or dragEnd functions. To find the issue you need to console log over active and over and see what's happening when you do a quick drag. It's tricky to make it right especially when you have 2 levels of drag and drop.

Thank you.
I found another example. I haven't checked it in detail, but it works well.

@manas-anarov
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants