W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2012

[whatwg] contentEditable and drag and drop cancel

From: Charles Pritchard <chuck@jumis.com>
Date: Tue, 31 Jan 2012 23:11:09 -0800
Message-ID: <4F28E58D.9030909@jumis.com>
On 1/31/12 10:55 PM, Ryosuke Niwa wrote:
> On Tue, Jan 31, 2012 at 10:51 PM, Ryosuke Niwa<rniwa at webkit.org>  wrote:
>> On Tue, Jan 31, 2012 at 10:16 PM, Charles Pritchard<chuck at jumis.com>wrote:
>>> **
>>> Yes, that's correct -- I'm testing on Chrome.
>>> I'd like to drag and drop a file from the desktop into a position in the
>>> contentEditable with one action.
>>> But, it seems that I have to cancel the default action of drag (to get
>>> the file)
>> Why do you have to do that? And when?
> I think I understand what you're saying now. For your use case, you should
> use dropzone content attribute:
> http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dropzone-attribute
> Then all you have to write is a drop event handler where you have access to
> clipboard data.

Well that certainly justifies the dropzone attribute. Have any vendors 
implemented it?

For authors: you can capture your ondragover events on your entire page, 
via the ondragover/ondragenter hooks, and simply use stopPropagation on 
them inside of your contentEditable. However, I don't see support for 
dropzone in the current Chrome (that's M16), and the WHATWG page has not 
documented any implementations amongst the vendors.

Received on Tuesday, 31 January 2012 23:11:09 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:39 UTC