Skip to content

Commit

Permalink
Allow SortableElements to move out of the parent element (#1771)
Browse files Browse the repository at this point in the history
Fix #1685 the Sortable component for "Ranking assistant replies bug - a
reply is too big"
  • Loading branch information
owenduncansnobel committed Feb 20, 2023
1 parent afc0670 commit ad8a6b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/src/components/Sortable/Sortable.tsx
Expand Up @@ -18,7 +18,7 @@ import {
useSensors,
} from "@dnd-kit/core";
import type { DragEndEvent } from "@dnd-kit/core/dist/types/events";
import { restrictToParentElement, restrictToVerticalAxis } from "@dnd-kit/modifiers";
import { restrictToVerticalAxis, restrictToWindowEdges } from "@dnd-kit/modifiers";
import {
arrayMove,
SortableContext,
Expand Down Expand Up @@ -77,7 +77,7 @@ export const Sortable = (props: SortableProps) => {
sensors={sensors}
collisionDetection={closestCenter}
onDragEnd={handleDragEnd}
modifiers={[restrictToParentElement, restrictToVerticalAxis]}
modifiers={[restrictToWindowEdges, restrictToVerticalAxis]}
>
<SortableContext items={itemsWithIds} strategy={verticalListSortingStrategy}>
<Flex direction="column" gap={2} className={extraClasses}>
Expand Down

0 comments on commit ad8a6b5

Please sign in to comment.