Comments (10)
Hey @pbteja1998, I haven't had time to look in-depth into the root cause of the issue in your case, that is, whether it is an issue in the library or a consumer error, but from what I can tell it appears like there was an id
collision with your sortable items. I updated the id
of the sortable items to something like sortable-${id}
which seems to have resolved the collision. More investigation will be required though.
https://codesandbox.io/s/dnd-kit-forked-hhfkk?file=/src/App.js
As for the issue with pages that are scrolled in the sidebar, it's an issue that was reported here and for which a fix is in progress: #43
from dnd-kit.
The fix has shipped in @dnd-kit/core^1.0.1
, let me know if you run into other issues related to unexpected id
collisions
from dnd-kit.
hi @clauderic, Thanks a lot for the help. Changing the id to sortable-${id}
seems to have fixed it.
Here is the updated code sandbox for reference.
https://codesandbox.io/s/dnd-kit-gm09q?file=/src/App.js
And Changing the collision strategy to closestCenter
also fixed the second scroll bug that I asked about.
Again, thanks a lot for the fast response.
I have one last question. Why is the id collision happening? From my understanding, they are in separate lists, aren't they? I was under the assumption that draggable items in the same list should have different ids, but it seems like all the draggable items on the entire page should have a different ID. Can you please clarify this?
Thanks.
from dnd-kit.
Hey @pbteja1998, after some investigation I've found that this was indeed an issue with the library and not a consumer error. Thanks for reporting this issue, it allowed me to uncover a really bad bug #51
from dnd-kit.
Hey @pbteja1998, after some investigation I've found that this was indeed an issue with the library and not a consumer error. Thanks for reporting this issue, it allowed me to uncover a really bad bug #51
@clauderic Awesome. Thanks for the clarification. Now, I will just wait for #43 to get fixed. Will try to go through the code myself and see if I can fix it myself and will raise a PR if I do so.
from dnd-kit.
Hey @pbteja1998, the PR with the fix is already open here #51 if you're curious about the fix, but thanks for offering to look into it
from dnd-kit.
Hey @pbteja1998, the PR with the fix is already open here #51 if you're curious about the fix, but thanks for offering to look into it
@clauderic Will this also fix #43 -- fixing RectIntersection algorithm inside a scrollable container?
from dnd-kit.
Oh sorry, I misread your comment. It will not, no. I have a separate fix in progress for #43
from dnd-kit.
Oh sorry, I misread your comment. It will not, no. I have a separate fix in progress for #43
Awesome. Thanks.
from dnd-kit.
Will update and revert back from sortable-${id}
to id
and check.
from dnd-kit.
Related Issues (20)
- useSortable draggable items moving twice HOT 2
- When I quickly move an item from one column to another empty column, the item gets deleted from the list. HOT 1
- Unable to scroll with mouse wheel when dragging HOT 2
- Mobile autoscroll is jumpy / jerky HOT 2
- Sortable in modal - `keydown` event propagation issue
- useDroppable changing state in useIsomorphicLayoutEffect forces a nested update
- Sortable when translating page - Uncaught DOMException: Failed to execute 'removeChild' on 'Node'
- Draggable element does not recalculate position after window resize and gets out of edges
- "Maximum update depth exceeded." in handleMove
- How to "freeze" items so that they always remain in the same location in vertical sortable lists? HOT 1
- Iframe drag&drop issue HOT 1
- useSortable data prop is spreaded and hence only copies owned properties.
- onDragCancel gets called when the iframe body height changes its width while an item is dragged
- Sortable with flex wrap
- useSortable re-renders all items even with just clicking one item, affecting performance HOT 5
- Scroll while dragging broked if container with dragable elements has `scroll-behavior: smooth`
- Issue with framer motion integration HOT 1
- dragging animation or collusion-detection issue
- rectSwappingStrategy has bad/unnecessary animation
- Element displacement when parent has transform property
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnd-kit.