From 2d547ff2eeb22df273f01d634934c568e53dbbf7 Mon Sep 17 00:00:00 2001 From: Kirk Swenson Date: Tue, 22 Oct 2024 10:28:00 -0700 Subject: [PATCH] chore: code review tweaks --- v3/src/components/drag-drop/attribute-drag-overlay.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v3/src/components/drag-drop/attribute-drag-overlay.tsx b/v3/src/components/drag-drop/attribute-drag-overlay.tsx index 97950b1fd3..2e4fefbf51 100644 --- a/v3/src/components/drag-drop/attribute-drag-overlay.tsx +++ b/v3/src/components/drag-drop/attribute-drag-overlay.tsx @@ -1,4 +1,4 @@ -import { DragOverlay, Modifiers, useDndContext } from "@dnd-kit/core" +import { DragOverlay, Modifier, Modifiers, useDndContext } from "@dnd-kit/core" import React, { CSSProperties } from "react" import { getDragAttributeInfo } from "../../hooks/use-drag-drop" @@ -28,14 +28,14 @@ export function AttributeDragOverlay ({ activeDragId, overlayHeight, overlayWidt ? { height: `${overlayHeight}px`, width: `${overlayWidth}px` } : undefined // Drags initiated by plugins have to be offset based on the location of the plugin - const modifier = (xOffset || yOffset) && ((args: any) => { + const modifier: Modifier | undefined = (xOffset || yOffset) ? (args => { const { x, y, scaleX, scaleY } = args.transform return { x: x + (xOffset ?? 0), y: y + (yOffset ?? 0), scaleX, scaleY } - }) + }) : undefined const modifiers: Modifiers | undefined = modifier ? [modifier] : undefined return (