Skip to content

Commit e9b4a61

Browse files
authored
Merge pull request #3 from github/cancel-drop
Cancel drop event to prevent browser navigation
2 parents 5aece37 + 93e4edc commit e9b4a61

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/sortable.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ function onDrop(event: DragEvent) {
120120
// Allow dragging task list item, not text, links, or files.
121121
if (!state) return
122122

123+
event.preventDefault()
124+
event.stopPropagation()
125+
123126
const dropzone = event.currentTarget
124127
if (!(dropzone instanceof Element)) return
125128

0 commit comments

Comments
 (0)