fix: error in tree table dragging and sorting (#2476)
This commit is contained in:
parent
9dc08277e1
commit
3fc3d34aa7
@ -304,10 +304,9 @@ export const Table: any = observer(
|
|||||||
}
|
}
|
||||||
const fromIndex = e.active?.data.current?.sortable?.index;
|
const fromIndex = e.active?.data.current?.sortable?.index;
|
||||||
const toIndex = e.over?.data.current?.sortable?.index;
|
const toIndex = e.over?.data.current?.sortable?.index;
|
||||||
const from = field.value[fromIndex];
|
const from = field.value[fromIndex] || e.active;
|
||||||
const to = field.value[toIndex];
|
const to = field.value[toIndex] || e.over;
|
||||||
field.move(fromIndex, toIndex);
|
onRowDragEnd({ from, to });
|
||||||
onRowDragEnd({ fromIndex, toIndex, from, to });
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<tbody {...props} />
|
<tbody {...props} />
|
||||||
|
Loading…
Reference in New Issue
Block a user