mdn / mdn/dom-examples

File-drag.html example not working

Open
#45 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: drag-and-drop bug help wanted
Dominant language
JavaScript
Stars
4k
Forks
1.9k
Avg merge
7h 53m
Merged PRs (30d)
1

Description

https://mdn.github.io/dom-examples/drag-and-drop/File-drag.html

In fact it is not working every time. Sometimes the file are detected, and their name is printed, sometimes not. The drop event is always fired.

Here is an output, showing that it only worked once:

File(s) in drop zone
File-drag.html:32:7
File(s) dropped File-drag.html:39:7
Removing drag data File-drag.html:65:7
File(s) in drop zone
File-drag.html:32:7
File(s) dropped File-drag.html:39:7
Removing drag data File-drag.html:65:7
File(s) in drop zone
File-drag.html:32:7
File(s) dropped File-drag.html:39:7
Removing drag data File-drag.html:65:7
File(s) in drop zone
File-drag.html:32:7
File(s) dropped File-drag.html:39:7
... file[0].name = screen_fluoread.png File-drag.html:50:13
Removing drag data

Files from os to browser using firefox. Using chrome there is no issues

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with File-drag.html, focusing on the logged points around lines 32, 39, 50, and 65. Reproduce dragging an OS file into Firefox and compare the behavior with Chrome, using the reported console output to trace when the file name is detected. Done means the example consistently reports the dropped file rather than only doing so intermittently.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.