1
0
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:
Thomas Heartman 2025-03-06 15:11:48 +01:00 committed by GitHub
parent 2e2bb9cf25
commit e5be1bf43e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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];