fix: dnd box z-index (#1353)

* fix: dnd box z-index

* fix: dnd boxes
This commit is contained in:
Akioe Yu
2024-07-08 10:49:57 +08:00
committed by GitHub
parent e371bbedc0
commit 2cd1fa6601
5 changed files with 53 additions and 7 deletions

View File

@@ -32,8 +32,14 @@ let eventListener: UnlistenFn | null = null;
export const TestItem = (props: Props) => {
const { itemData, onEdit, onDelete: onDeleteItem } = props;
const { attributes, listeners, setNodeRef, transform, transition } =
useSortable({ id: props.id });
const {
attributes,
listeners,
setNodeRef,
transform,
transition,
isDragging,
} = useSortable({ id: props.id });
const { t } = useTranslation();
const [anchorEl, setAnchorEl] = useState<any>(null);
@@ -99,8 +105,10 @@ export const TestItem = (props: Props) => {
return (
<Box
sx={{
position: "relative",
transform: CSS.Transform.toString(transform),
transition,
zIndex: isDragging ? "calc(infinity)" : undefined,
}}
>
<TestBox