You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI!
when using drag and drop, most usages are for re-ordering elements, e.g. in a table. So it does not feel right if I want to re-order a table which items are sorted by name (a table component accepts a list of items as input and renders items.sort(...) on the output)
But there may be use cases, for example I have a table in which items are grouped by, then displayed (without sorting) and then there should be drag and drop available within each group.
I believe with current workflow of this library I'll have to store the reduced and filtered items in a separate state, or a plain object/array so that it would be find-able in onDragEnd in which only index of items are known.
I want to be able to get more information on my onDragEnd of source and destination rather than just their index. Because my indexes are not correctly mapped to my input or what i've rendered in my component. It would be very nice to be able to pass data to onDragEnd function. e.g. each of my Draggables bear an object with themselves, or even a simple string if for any good reason object would not be appropriate.
In my component the code above is handled by too many coupled components and my DragDropContext is in a higher level. So I wouldn't find it appropriate to restructure my code so that final form of dataStructure be defined above my DragDropContext
The text was updated successfully, but these errors were encountered:
Does anyone have an answer to this Issue? I have a similar situation, I have 3 to-do lists and I want to drag-and-drop between them and keep the state. But I need the index of the task in relation to the list. The only way I found was to keep a separate hash to store the indexes, but that's not very elegant.
Description
HI!
when using drag and drop, most usages are for re-ordering elements, e.g. in a table. So it does not feel right if I want to re-order a table which items are sorted by name (a table component accepts a list of items as input and renders
items.sort(...)
on the output)But there may be use cases, for example I have a table in which items are grouped by, then displayed (without sorting) and then there should be drag and drop available within each group.
I believe with current workflow of this library I'll have to store the reduced and filtered items in a separate state, or a plain object/array so that it would be find-able in
onDragEnd
in which onlyindex
of items are known.I want to be able to get more information on my
onDragEnd
ofsource
anddestination
rather than just theirindex
. Because myindex
es are not correctly mapped to my input or what i've rendered in my component. It would be very nice to be able to pass data toonDragEnd
function. e.g. each of myDraggable
s bear an object with themselves, or even a simple string if for any good reason object would not be appropriate.This is some (psuedotor)code example:
In my component the code above is handled by too many coupled components and my
DragDropContext
is in a higher level. So I wouldn't find it appropriate to restructure my code so that final form of dataStructure be defined above myDragDropContext
The text was updated successfully, but these errors were encountered: