Skip to content

Commit

Permalink
Add activatorEvent to DragStartEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
anilanar committed May 26, 2023
1 parent 5c58f0f commit 545a41c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/smart-spies-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dnd-kit/core': minor
---

Add `activatorEvent` to `DragStartEvent`
1 change: 1 addition & 0 deletions packages/core/src/components/DndContext/DndContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ export const DndContext = memo(function DndContext({

const {onDragStart} = latestProps.current;
const event: DragStartEvent = {
activatorEvent,
active: {id, data: draggableNode.data, rect: activeRects},
};

Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/types/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ interface DragEvent {
over: Over | null;
}

export interface DragStartEvent extends Pick<DragEvent, 'active'> {}
export interface DragStartEvent
extends Pick<DragEvent, 'active' | 'activatorEvent'> {}

export interface DragMoveEvent extends DragEvent {}

Expand Down

0 comments on commit 545a41c

Please sign in to comment.