New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 795966 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

dataTransfer.setDragImage no longer works with dom element other than img

Reported by glendavi...@gmail.com, Dec 19 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36

Steps to reproduce the problem:
1. Set drag image in a dragStart event as follows
const div = document.createElement('div');
div.innerHTML = '<span class="msg">Hello world.</span>';
document.body.appendChild(div);
event.dataTransfer.setDragImage(div, 0, 0);
setTimeout(() => {
    div.remove();
});

2. Drag the draggable element to which the event is attached

What is the expected behavior?
Prior to Chrome 63 this would result in the default drag image being replaced with the html element specified. This is still the behavior in Firefox and Safari

What went wrong?
In Chrome 63 with the above code there is now no drag image shown. If an img element is used instead of a div the code works as expected - however this is not an alternative as we are using setDragImage to set the drag image to a snapshot of the element being dragged.

Did this work before? Yes < 63

Chrome version: 63.0.3239.108  Channel: stable
OS Version: 6.3
Flash Version:
 

Comment 1 by woxxom@gmail.com, Dec 19 2017

Works for me in 63.0.3239.108 as well as 62 and 65 using the attached test.html.
test.html
630 bytes View Download
ok - looks like it is something in Angular that is causing the issue with Chrome 63 and setDragImage - works fine in vanilla html/javascript, but within Angular component doesn't - but did in versions < 63. Will head over to the Angular issues tracker and see if any details there.
Labels: Needs-Bisect Needs-Triage-M63
Cc: vamshi.k...@techmahindra.com
Labels: Needs-Feedback Triaged-ET
Unable to reproduce the issue on reported chrome version 63.0.3239.108 and on the latest canary 65.0.3299.0 using windows 10 with the below mentioned steps.

1. Launched Chrome
2. Created a .html file using the code given in comment#0
3. Opened the created html file
4. It rendered "const div = document.createElement('div'); div.innerHTML = 'Hello world.'; document.body.appendChild(div); event.dataTransfer.setDragImage(div, 0, 0); setTimeout(() => { div.remove(); });"

We did not observe any drag image. In addition to that we also checked it using the test file provided in comment#1 which showed a drag image, we were able to drag that image. Attaching the screen cast of the steps followed. 

Note: Checked the behavior in Firefox(shown in screen cast) where the image can not be dragged.

@Reporter: Could you please check the screen cast and let us know if we have missed any steps in reproducing the issue. It would be highly helpful if you confirm whether the code provided in comment#0 should render a drag image or not. Any further inputs from your end helps us to triage the issue in a better way.

Thanks!
795966.mp4
4.5 MB View Download
Hi
As noted in comment #2 we have verified that the functionality works as expected with plain html and javascript as in comment #!. The issue appears to be when the code is wrapped in an Angular component, so we assume this is an Angular issue, not a chrome issue so this bug can be closed.
Project Member

Comment 6 by sheriffbot@chromium.org, Dec 20 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: nyerramilli@chromium.org
Labels: -Needs-Bisect
Status: WontFix (was: Unconfirmed)
glendaviesnz@, thanks for the update. 

Based on your comment #5, we are closing the issue.

If you are seeing the error or have new data, please file a new issue and fill out the template with issue details, steps to reproduce the issue, device details & Chrome version that would be helpful in triaging the issue from our end.

Comment 8 by maarten....@42.nl, Jan 3 2018

I'm seeing some strange behavior as well on the latest chrome, when dragging with a custom `setDragImage`.

Steps to reproduce:

1. Go to http://mereskin.github.io/dnd/#drag-image
2. Now drag the "I have custom dragImage. I don't work in IE." green block.
3. Notice that it shows a 'file icon' but not the drag image.

It does work in Safari and FireFox.

Chrome version is "Version 63.0.3239.108 (Official Build) (64-bit)"


Jan-03-2018 11-47-52.mp4
1.1 MB View Download

Comment 9 by woxxom@gmail.com, Jan 3 2018

maarten....@42.nl that's a different bug broken in r501851

Comment 10 by maarten....@42.nl, Jan 3 2018

@woxxom Can you provide a link to the issue itself. I cannot find it.

Comment 11 by woxxom@gmail.com, Jan 3 2018

There's no dedicated issue for that bug so it might be reasonable to file a new report because the author of the bad commit will be absent until March.

Sign in to add a comment