@@ -15,6 +15,7 @@ import { toCssRgba } from "@utils/colorUtils";
1515import { useSmartGuidesElements } from "@hooks/Grid" ;
1616import { useSmartGuidesStore } from "@stores/useSmartGuidesStore" ;
1717import { useSettingsStore } from "@stores/useSettingsStore" ;
18+ import { useGridSelectionStore } from "@stores/useGridSelectionStore" ;
1819import {
1920 calculateBounds ,
2021 calculateSnapPoints ,
@@ -57,6 +58,11 @@ export default function DraggableKey({
5758 // 스마트 가이드를 위한 다른 요소들의 bounds 가져오기
5859 const { getOtherElements } = useSmartGuidesElements ( ) ;
5960
61+ // 드래그/리사이즈 중인 상태 (CSS 애니메이션 비활성화용)
62+ const isDraggingOrResizing = useGridSelectionStore (
63+ ( state ) => state . isDraggingOrResizing
64+ ) ;
65+
6066 // 다중 선택 드래그 상태
6167 const multiDragRef = useRef ( { isDragging : false , startX : 0 , startY : 0 } ) ;
6268 const nodeRef = useRef ( null ) ;
@@ -97,6 +103,9 @@ export default function DraggableKey({
97103 // 드래그 시작 전 기존 스마트 가이드 클리어 (이전 드래그가 정상 종료되지 않은 경우 대비)
98104 useSmartGuidesStore . getState ( ) . clearGuides ( ) ;
99105
106+ // 드래그 시작 시 애니메이션 비활성화
107+ useGridSelectionStore . getState ( ) . setDraggingOrResizing ( true ) ;
108+
100109 // 드래그 시작 시 히스토리 저장
101110 onMultiDragStart ?. ( ) ;
102111
@@ -326,6 +335,8 @@ export default function DraggableKey({
326335 window . removeEventListener ( "blur" , handleMouseUp ) ;
327336 // 스마트 가이드 클리어
328337 useSmartGuidesStore . getState ( ) . clearGuides ( ) ;
338+ // 드래그 종료 시 애니메이션 복원
339+ useGridSelectionStore . getState ( ) . setDraggingOrResizing ( false ) ;
329340 // 드래그 종료 시 오버레이 동기화
330341 onMultiDragEnd ?. ( ) ;
331342 } ;
@@ -449,6 +460,7 @@ export default function DraggableKey({
449460 } ${ className || "" } `}
450461 style = { keyStyle }
451462 data-state = "inactive"
463+ data-editing = { isDraggingOrResizing ? "true" : undefined }
452464 onClick = { handleClick }
453465 onMouseDown = { isSelectionMode ? handleSelectionDragMouseDown : undefined }
454466 onContextMenu = { handleContextMenu }
0 commit comments