diff --git a/app/features/tier-list-maker/components/DraggableItem.module.css b/app/features/tier-list-maker/components/DraggableItem.module.css index 63c88faa1..e22f2d388 100644 --- a/app/features/tier-list-maker/components/DraggableItem.module.css +++ b/app/features/tier-list-maker/components/DraggableItem.module.css @@ -1,4 +1,5 @@ .item { + min-height: 50px; cursor: move; touch-action: none; user-select: none; diff --git a/app/features/tier-list-maker/components/TierRow.tsx b/app/features/tier-list-maker/components/TierRow.tsx index 73d25d459..c4cc36b33 100644 --- a/app/features/tier-list-maker/components/TierRow.tsx +++ b/app/features/tier-list-maker/components/TierRow.tsx @@ -5,6 +5,7 @@ import { } from "@dnd-kit/sortable"; import clsx from "clsx"; import { ChevronDown, ChevronUp, Trash } from "lucide-react"; +import { useLayoutEffect, useRef } from "react"; import { Button } from "react-aria-components"; import { useTranslation } from "react-i18next"; import { SendouButton } from "~/components/elements/Button"; @@ -28,6 +29,7 @@ interface TierRowProps { export function TierRow({ tier }: TierRowProps) { const { state, + activeItem, getItemsInTier, handleRemoveTier, handleRenameTier, @@ -44,6 +46,11 @@ export function TierRow({ tier }: TierRowProps) { id: tier.id, }); + const combinedRef = useLockedHeightWhileDragging({ + setNodeRef, + isDragging: activeItem !== null, + }); + const tierIndex = state.tiers.findIndex((t) => t.id === tier.id); const isFirstTier = tierIndex === 0; const isLastTier = tierIndex === state.tiers.length - 1; @@ -121,7 +128,7 @@ export function TierRow({ tier }: TierRowProps) { ) : null}