-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra information while dragging #298
Comments
The new hook is a little scary as I would not want to hurt drag performance which could be caused by heavy processing in an onMove hook. Whether or not we call it on every drag update (60fps) is still to be thought about. I think it reasonable that it can be called whenever the |
How about extending I have run into well-known bugs on mobile Safari involving |
@twiggler I am not sure of the bug you speak of. Can you please create another issue to describe it in more detail? I am keen to avoid getting sidetracked in this issue |
I will not create a separate issue, because the clipping is not an issue with The reference to the clipping problem was solely ment as a motivation for extending |
Right now we do provide all of the information you need to know exactly what is going on during a drag.
onDragStart
: what is dragging (draggableId
)DroppableStateSnapshot > isDraggingOver
: what is being dragged overDraggableStateSnapshot > isDragging
: which item is dragging from within.While it is possible to pass this information around a system it can be cumbersome to know a few things like:
isDraggingOver
andisDragging
changesAdditionally, providing this information around can hurt performance as it most likely relies on calling
render()
to pass props to thingsProposal
1. Add some new information to
DroppableStateSnapshot
:Add details about what draggable is currently dragging over it.
export type StateSnapshot = {| isDraggingOver: boolean, + draggingOver: ?draggableId, |}
Alternative - just swap from boolean
2. Add some new information to
DraggableStateSnapshot
:Provide information about what Droppable is being dragged over by the Draggable
export type StateSnapshot = {| isDragging: boolean, + isDraggingOver: ?droppableId |}
3. Add a new system hook:
onDragMove
Relevant issues: #287 #144 (there are probably more also!)
The text was updated successfully, but these errors were encountered: