Skip to content

Commit

Permalink
Fix an issue where dragging wont work without activation constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
jain-sachin committed Oct 9, 2024
1 parent 00ec286 commit b3de0f7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/core/src/components/DndContext/DndContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ export const DndContext = memo(function DndContext({
);

const activeSensorRef = useRef<SensorInstance | null>(null);
const activatorEventRef = useRef<Event | null>(null);
const instantiateSensor = useCallback(
(
event: React.SyntheticEvent,
Expand Down Expand Up @@ -374,7 +373,7 @@ export const DndContext = memo(function DndContext({
});
dispatchMonitorEvent({type: 'onDragStart', event});
setActiveSensor(activeSensorRef.current);
setActivatorEvent(activatorEventRef.current);
setActivatorEvent(activatorEvent);
});
},
onMove(coordinates) {
Expand All @@ -388,7 +387,6 @@ export const DndContext = memo(function DndContext({
});

activeSensorRef.current = sensorInstance;
activatorEventRef.current = event.nativeEvent;

function createHandler(type: Action.DragEnd | Action.DragCancel) {
return async function handler() {
Expand Down Expand Up @@ -425,7 +423,6 @@ export const DndContext = memo(function DndContext({
setActiveSensor(null);
setActivatorEvent(null);
activeSensorRef.current = null;
activatorEventRef.current = null;

const eventName =
type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel';
Expand Down

0 comments on commit b3de0f7

Please sign in to comment.