Git Product home page Git Product logo

Comments (10)

clauderic avatar clauderic commented on May 18, 2024 1

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.

clauderic avatar clauderic commented on May 18, 2024 1

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.

pbteja1998 avatar pbteja1998 commented on May 18, 2024

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.

clauderic avatar clauderic commented on May 18, 2024

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.

pbteja1998 avatar pbteja1998 commented on May 18, 2024

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.

clauderic avatar clauderic commented on May 18, 2024

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.

pbteja1998 avatar pbteja1998 commented on May 18, 2024

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.

clauderic avatar clauderic commented on May 18, 2024

Oh sorry, I misread your comment. It will not, no. I have a separate fix in progress for #43

from dnd-kit.

pbteja1998 avatar pbteja1998 commented on May 18, 2024

Oh sorry, I misread your comment. It will not, no. I have a separate fix in progress for #43

Awesome. Thanks.

from dnd-kit.

pbteja1998 avatar pbteja1998 commented on May 18, 2024

Will update and revert back from sortable-${id} to id and check.

from dnd-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.