Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93e4edc

Browse files
committed
Cancel drop event to prevent browser navigation
Firefox attempts navigation to the domain represented by the task listitem text.Once we've determined the drop event is a task list item dropping onto atask list, cancel any default browser behavior and handle the eventlocally. If the drop event is for something other than a list item,ignore it and allow the browser or another upstream event listener tohandle it.
1 parent5aece37 commit93e4edc

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
constdropzone=event.currentTarget
124127
if(!(dropzoneinstanceofElement))return
125128

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp