New issue
Advanced search Search tips

Issue 648307 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Drag a 'ghost' using dataTransfer.setDragImage no longer working as desired in v53

Reported by smal...@lapresse.ca, Sep 19 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36

Steps to reproduce the problem:
1. create a hidden block <div id="myblock_123">
2. when dragstart is called do : event.dataTransfer.setDragImage(document.getElementById("myblock_123"), 40, 22);

What is the expected behavior?
The ghost image following the cursor is exactly as specified in the div + its class styles. In our case, simply a blue box with a border and some text in it having a defined width and height.

What went wrong?
The styles no longer follow the ghost. It only keeps the width and height, and then uses the rendered HTML document as the content shown in the ghost (if the ghost div is hidden under a select box with some text, thats what appears in the ghost being dragged).

Did this work before? Yes v52

Chrome version: 53.0.2785.116  Channel: stable
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 23.0 r0

In this spec : https://developer.mozilla.org/fr/docs/Web/API/DataTransfer/setDragImage it says to use an img or canvas, so I tried with a canvas, but it does exactly the same thing. No CSS ever follow properly.
 
Components: -Blink Blink>DataTransfer

Comment 2 by dcheng@chromium.org, Sep 19 2016

Do you have a self-contained example? That'll make it easier to bisect this done.

Comment 3 by smal...@lapresse.ca, Sep 20 2016

The way this was implemented on our end is too deep to do a a self-contained example. So I tried to create a little snippet of code here : https://plnkr.co/edit/WNzRBfTXYZlwfqmeofN1?p=preview 

but it's working :)
(In the plnkr example it simulates having two divs on top of each other and doing a ghost drag image using the div which is under the other one).

So it means the way we did it is wrong. I was able to fix it in our code by having a zindex above all other elements and adding "left: -1000px" so the items are always active in the dom but hidden from view.

I think you can close this ticket.

Thanks guys.

Comment 4 by pwnall@chromium.org, Sep 27 2016

Status: WontFix (was: Unconfirmed)
Closing per #3.

Thank you for reporting!

Sign in to add a comment