Skip to content

Commit

Permalink
fix DragEventPlugin to not fire stopped drag event on drop
Browse files Browse the repository at this point in the history
  • Loading branch information
TahaSh committed Sep 21, 2024
1 parent 8d9880d commit 95f2a8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="./examples/react-spa/main.tsx"></script>
</body>
</html>
5 changes: 4 additions & 1 deletion src/builtin-plugins/DragEventPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ export class DragEventPlugin extends EventPlugin {

clearTimeout(this._stopTimer)
this._stopTimer = setTimeout(() => {
this._emitEvent(view, directions, true)
const isDragging = this._pointerDownPerView.get(view.id) === true
if (isDragging) {
this._emitEvent(view, directions, true)
}
}, 120)
}
})
Expand Down

0 comments on commit 95f2a8c

Please sign in to comment.