Skip to content

Commit

Permalink
Fix orderable
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Sep 27, 2022
1 parent 075bc9f commit 486e761
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ export function OrderableList(props: {
const overIndex = props.elements.findIndex(
x => (typeof x === 'string' ? x : x.key) === over.id
);
const newValue = arrayMove(props.elements as { key: string }[], activeIndex, overIndex);
const newValue = arrayMove(
props.elements.map(x => ({ key: x.key })),
activeIndex,
overIndex
);
props.onChange(newValue);
}
}}
Expand Down

0 comments on commit 486e761

Please sign in to comment.