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 1dcc95d16a
commit 9d045e24db
5 changed files with 53 additions and 7 deletions

View File

@@ -20,7 +20,14 @@ export const ProxyItem = (props: Props) => {
let { type, proxy, onDelete } = props;
const sortable = type === "prepend" || type === "append";
const { attributes, listeners, setNodeRef, transform, transition } = sortable
const {
attributes,
listeners,
setNodeRef,
transform,
transition,
isDragging,
} = sortable
? useSortable({ id: proxy.name })
: {
attributes: {},
@@ -28,12 +35,14 @@ export const ProxyItem = (props: Props) => {
setNodeRef: null,
transform: null,
transition: null,
isDragging: false,
};
return (
<ListItem
dense
sx={({ palette }) => ({
position: "relative",
background:
type === "original"
? palette.mode === "dark"
@@ -47,6 +56,7 @@ export const ProxyItem = (props: Props) => {
borderRadius: "8px",
transform: CSS.Transform.toString(transform),
transition,
zIndex: isDragging ? "calc(infinity)" : undefined,
})}
>
<ListItemText