Issue metadata
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:
,
Dec 19 2017
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.
,
Dec 19 2017
,
Dec 20 2017
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!
,
Dec 20 2017
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.
,
Dec 20 2017
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
,
Dec 21 2017
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.
,
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 3 2018
maarten....@42.nl that's a different bug broken in r501851
,
Jan 3 2018
@woxxom Can you provide a link to the issue itself. I cannot find it.
,
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 |
|||||||||||||||||||||||
Comment 1 by woxxom@gmail.com
, Dec 19 2017630 bytes
630 bytes View Download