Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sensorEvent property to 'drag:stop' and 'drag:stopped' event #457

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Draggable/Draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,12 @@ export default class Draggable {

this.dragging = false;

const sensorEvent = getSensorEvent(event);
const dragStopEvent = new DragStopEvent({
source: this.source,
originalSource: this.originalSource,
sensorEvent: event.sensorEvent,
sourceContainer: this.sourceContainer,
sensorEvent,
});

this.trigger(dragStopEvent);
Expand Down Expand Up @@ -605,8 +606,8 @@ export default class Draggable {
const dragStoppedEvent = new DragStoppedEvent({
source: this.source,
originalSource: this.originalSource,
sensorEvent: event.sensorEvent,
sourceContainer: this.sourceContainer,
sensorEvent,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the code here because drag:stopped also needs this fix.

});

this.trigger(dragStoppedEvent);
Expand Down