Comments (5)
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.
No worries - there's always something to learn :)
from solid-dnd.
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.
I'm not following what the issue is. You can use
onDragOver
which is passed the currently activedroppable
(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.
droppable
will benull
when not over a droppable.This is why you get the error
Uncaught TypeError: droppable is null
when you try to accessdroppable.id
without checkingdroppable
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)
- Bento Draggable Layout HOT 2
- attach is used before it is defined HOT 1
- Non deterministic order of events onDragStart, onDragOver, onDragMove
- solid-dnd.com is down! HOT 2
- Get `useDragDropContext is not a function or its return value is not iterable` HOT 1
- TypeError: useDragDropContext is not a function or its return value is not iterable at createDroppable HOT 8
- Allowing access to mouse position on drag & drop context's events HOT 3
- how to rotate a SortableProvider / useSortableContext returns null HOT 1
- Document "touch-none" css for draggables or set it automatically HOT 1
- createDraggable and createDroppable are not reactive HOT 2
- Conditionally Prevent Drag HOT 1
- Draggable SVG shape moves faster than pointer HOT 4
- Unable to load data dynamically. Please help HOT 2
- Recompute layouts on remove
- Access state and actions from callback handlers
- Get current droppable on onDragMove HOT 1
- Only the text is visible on the dragged element HOT 1
- Add support for sortables of irregular sizes. HOT 4
- Beginners Documentation HOT 10
- Trying to render a custom component as sortable HOT 4
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 solid-dnd.