Skip to content

Commit

Permalink
Key on unique pattern ID rather than child index, so focus isn't lost…
Browse files Browse the repository at this point in the history
… on an item after reordering. (#180)
  • Loading branch information
danielnaab authored Jun 7, 2024
1 parent abaa08e commit 3dee867
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const DraggableList: React.FC<DraggableListProps> = ({
{arrayChildren.map((child, index) => {
const patternId = order[index];
return (
<SortableItem key={index} id={patternId}>
<SortableItem key={patternId} id={patternId}>
{child}
</SortableItem>
);
Expand Down

0 comments on commit 3dee867

Please sign in to comment.