Open Bug 1824740 Opened 1 year ago Updated 3 months ago

DataTransfer.setData is adding the data in the wrong order when the format already exists

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect)

defect

Tracking

()

People

(Reporter: enndeakin, Assigned: edgar)

References

Details

Attachments

(1 file)

To reproduce: Open the testcase, select the 'Drag Me' text and drag it.

The testcase calls setData three times:

event.dataTransfer.setData('text/plain', 'There is some text here.');
event.dataTransfer.setData('text/horse', 'There is some horse here.');
event.dataTransfer.setData('text/plain', 'There is some elephant here.');

The last line adds data of the same format that already exists. The spec says that setData should remove the existing item first and then add the new data. This is what other browsers do. Firefox however replaces the item in the same position instead.

See Also: → 1820332
Severity: -- → S3
Flags: needinfo?(echen)
Assignee: nobody → echen
Flags: needinfo?(echen)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: