Should canDrop: () => false also block dropping on children? #45
alexreardon
started this conversation in
Ideas
Replies: 1 comment
-
I’m currently struggling with this one! My brain can’t quite figure out how best to disable all my child droppables. I tried storing location.current.dropTargets inside of a react ref from the onDropTargetsChanged callback, then grab the source from canDrop and just check if the source element exists in the first drop target element via element.contains() Would love to see an example of how this might be done. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Started from: #44
Right now each drop target can specify whether it can be dropped on with
canDrop
.canDrop: () => false
will not block dropping on parents or children. Some people might expect that a disabled parent should disable children (eg like a how a disabled<fieldset>
element disables internal form elements).A few potential options:
canDrop()
behaviour istrue
. I don't think we should distinguish between explicitcanDrop: () => true
and a defaultcanDrop: () => true
as that adds extra hidden meaning to the APII lean towards keep the current state for maximum flexibility, but I fully accept I might be off about this one. Keen to know what others think
Beta Was this translation helpful? Give feedback.
All reactions