fix: draggable index didn't worked well sometimes

This commit is contained in:
Stefano Brilli 2021-07-25 16:49:06 +02:00
parent 4cb685b1b4
commit a24e4e154f
1 changed files with 5 additions and 5 deletions

View File

@ -610,14 +610,14 @@ export const Main = (props: {}) => {
{group.title === null && group.tracks.length === 0 && (
<TableRow style={{ height: '1px' }} />
)}
{group.tracks.map(n => (
{group.tracks.map((t, tidx) => (
<Draggable
draggableId={`${group.index}-${n.index}`}
key={`${n.index - group.tracks[0].index}`}
index={n.index - group.tracks[0].index}
draggableId={`${group.index}-${t.index}`}
key={`t-${t.index}`}
index={tidx}
>
{(provided: DraggableProvided) =>
getTrackRow(n, group.title !== null, provided)
getTrackRow(t, group.title !== null, provided)
}
</Draggable>
))}