event.dataTransfer.getData return empty string in dragover event

By design Issue #4597368

Details

Created
Sep 15, 2015
Privacy
This issue is public.
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

URL:

Repro Steps:

Paste the following html into a file test.html and open it with IE. When you drag the gray box, text “empty” will appear. But if you do that in Chrome, you will see "testing drag and drop".

<!-- saved from url=(0016)http://localhost -->
<!DOCTYPE html>
<html xmlns=’http://www.w3.org/1999/xhtml’>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=10" />
</head>
<body id="body">
<div id="data"></div>
<div id="item" draggable="true" style="position:absolute; left: 100px; top: 100px; background-color: #888888; width: 100px; height: 100px;"></div>
<script>
var item = document.getElementById(‘item’);
item.addEventListener('dragstart’, function (e) {
e.dataTransfer.setData('Text’, ‘testing drag and drop’);
}, false);
var body = document.getElementById(‘body’);
body.addEventListener('dragover’, function (e) {
e.preventDefault();
var text = e.dataTransfer.getData(‘Text’);
if (text == null || text.length == 0) {
text = 'empty’;
}
document.getElementById(‘data’).innerText = text;
}, false);
</script>
</body>
</html>

Expected Results:

event.dataTransfer.getData in the dragover event should function the same as that in the drop event.

Actual Results:

Dev Channel specific:

No

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Mara P.”

      Changed Assigned To to “Christian F.”

      Changed Assigned To to “Sermet I.”

      Changed Assigned To from “Sermet I.” to “Bruce L.”

      Changed Status to “Confirmed”

      Changed Status from “Confirmed” to “In progress”

      Changed Assigned To from “Bruce L.” to “IE S.”

      Changed Status from “In progress” to “By design”

    You need to sign in to your Microsoft account to add a comment.

    Sign in