0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ファイルのdropイベントが発火しないときに見るメモ

Posted at

drag and drop の実装をしたいとき
dragenter、dragleave は発火するのに drop だけが発火しない事象に遭遇した。

ブラウザデフォルトの 画像をブラウザ上で表示する機能をキャンセルする必要があった

// ファイルドロップしたときに ブラウザデフォルトの 画像をブラウザ上で表示する機能をキャンセル
const htmlReplaceCancel = (e) => {
  e.preventDefault()
  return false
}
document.addEventListener('dragover', htmlReplaceCancel)
document.addEventListener('drop', htmlReplaceCancel)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?