mirror of
https://github.com/Unleash/unleash.git
synced 2025-03-18 00:19:49 +01:00
Fix: drag and drop reverts to previous position on drop (#9439)
Fixes an issue where, when dragging large expanded milestone cards, the position would revert from the current visual state to the previous one when you drop the item.
This commit is contained in:
parent
2e2bb9cf25
commit
e5be1bf43e
@ -32,7 +32,11 @@ export const MilestoneList = ({
|
||||
}: IMilestoneListProps) => {
|
||||
const useNewMilestoneCard = useUiFlag('flagOverviewRedesign');
|
||||
const onMoveItem: OnMoveItem = useCallback(
|
||||
async (dragIndex: number, dropIndex: number) => {
|
||||
async (dragIndex: number, dropIndex: number, save?: boolean) => {
|
||||
if (useNewMilestoneCard && save) {
|
||||
return; // the user has let go, we should leave the current sort order as it is currently visually displayed
|
||||
}
|
||||
|
||||
if (dragIndex !== dropIndex) {
|
||||
const oldMilestones = milestones || [];
|
||||
const newMilestones = [...oldMilestones];
|
||||
|
Loading…
Reference in New Issue
Block a user