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

[whatwg] Proposed addition to Drag and Drop API

From: Alex Bain <alex@alexba.in>
Date: Fri, 29 Jun 2012 16:12:51 -0700
To: whatwg@lists.whatwg.org
Message-ID: <D56A4F5B174B401C9673EEAAFE453452@alexba.in>

I've spent the past few days working with the Drag and Drop API and I'd like to propose an addition to the spec to aid developers and designers in creating accessible drag interfaces.

**Use case:**

I'm developing an app that allows users to drag pieces of user generated content (Posts) from one part of the app to another. A Post is represented as a DOM subtree with multiple components - a title, some images, text, and so forth. I wanted to create an interaction where the user could click and drag anywhere on the Post (large click target for accessibility purposes), see a subset of the Post as a drag indicator (the title, for example), and then be able to drop that elsewhere in the app.

**Existing solutions:**

1) I can define a custom drag image that is shown during drag.
2) I can define a custom canvas element that is shown during drag.

1) In this situation a custom drag image would not solve the problem. I would not be able to predefine images for all possible post titles. I could represent all drag actions with a single image but I believe that providing something contextually relevant (an actual component of the post) would be of benefit to users.
2) The custom canvas element could solve this problem but feels unwieldy.

**Proposed solution:**

In the scenario above I would prefer to define a custom drag element, set the innerHTML to a component of the Post (title), and then style the element itself in CSS.


- Alex
Received on Friday, 29 June 2012 23:13:35 UTC

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