Skip to content

Commit

Permalink
set activator node
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperkristensen committed Nov 19, 2024
1 parent 08e3466 commit 25c2509
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ const MediaItem = ({ field, onDelete, onMakeThumbnail }: MediaItemProps) => {
attributes,
listeners,
setNodeRef,
setActivatorNodeRef,
transform,
transition,
isDragging,
Expand All @@ -199,9 +200,11 @@ const MediaItem = ({ field, onDelete, onMakeThumbnail }: MediaItemProps) => {
<div className="flex items-center gap-x-2">
<IconButton
variant="transparent"
type="button"
size="small"
{...attributes}
{...listeners}
ref={setActivatorNodeRef}
className="cursor-grab touch-none active:cursor-grabbing"
>
<DotsSix className="text-ui-fg-muted" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ const MediaGridItem = ({
attributes,
listeners,
setNodeRef,
setActivatorNodeRef,
transform,
transition,
isDragging,
Expand All @@ -379,7 +380,9 @@ const MediaGridItem = ({

return (
<div
className="shadow-elevation-card-rest hover:shadow-elevation-card-hover focus-visible:shadow-borders-focus bg-ui-bg-subtle-hover group relative aspect-square h-auto max-w-full overflow-hidden rounded-lg outline-none"
className={clx(
"shadow-elevation-card-rest hover:shadow-elevation-card-hover focus-visible:shadow-borders-focus bg-ui-bg-subtle-hover group relative aspect-square h-auto max-w-full overflow-hidden rounded-lg outline-none"
)}
style={style}
ref={setNodeRef}
>
Expand All @@ -394,6 +397,7 @@ const MediaGridItem = ({
className={clx("absolute inset-0 cursor-grab touch-none outline-none", {
"cursor-grabbing": isDragging,
})}
ref={setActivatorNodeRef}
{...attributes}
{...listeners}
/>
Expand Down

0 comments on commit 25c2509

Please sign in to comment.