Code Monkey home page Code Monkey logo

Comments (5)

martinpengellyphillips avatar martinpengellyphillips commented on June 2, 2024 1

droppable will be null when not over a droppable.

This is why you get the error Uncaught TypeError: droppable is null when you try to access droppable.id without checking droppable is defined.

from solid-dnd.

martinpengellyphillips avatar martinpengellyphillips commented on June 2, 2024 1

No worries - there's always something to learn :)

from solid-dnd.

martinpengellyphillips avatar martinpengellyphillips commented on June 2, 2024

I'm not following what the issue is. You can use onDragOver which is passed the currently active droppable (and will be reactively called whenever it changes). What's not working for you with that?

Note: This library doesn't use native dnd events at all as they are too limiting for most use cases.

from solid-dnd.

ivanjeremic avatar ivanjeremic commented on June 2, 2024

I'm not following what the issue is. You can use onDragOver which is passed the currently active droppable (and will be reactively called whenever it changes). What's not working for you with that?

Note: This library doesn't use native dnd events at all as they are too limiting for most use cases.

You need to ensure you are updating the ids array to reflect the new order. E.g. https://codesandbox.io/s/solid-dnd-desk-forked-ojr74x

The issue is when using droppable inside onDragOver the dnd stops working but the id gets logged, On line 63 is the issue I have commented the issue in this new SandBox https://codesandbox.io/s/solid-dnd-desk-droppable-id-4b7n4l?file=/src/main.tsx Thanks

from solid-dnd.

ivanjeremic avatar ivanjeremic commented on June 2, 2024

droppable will be null when not over a droppable.

This is why you get the error Uncaught TypeError: droppable is null when you try to access droppable.id without checking droppable is defined.

So sorry for asking these basic questions I'm a bit overwhelmed learning solid and same time rewriting my project in it, you are right it works now when checking. Thanks I will close this now.

from solid-dnd.

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.