[whatwg] Proposal for public data in drag events

Ian Hickson ian at hixie.ch
Mon Dec 10 11:50:01 PST 2012

On Thu, 30 Aug 2012, Trevor Burnham wrote:
> The main use case I have in mind is an interface where elements respond 
> to the object being dragged. A common case is showing visual feedback 
> depending on whether the element emitting a dragenter/dragover is a 
> valid drop target for the object being dragged. Currently, this can only 
> be done in response to the types attribute.

Right, that's what the type is for.

> Using global state in tandem with the types attribute is a viable 
> workaround for drags within a document, but an inelegant one.


The types are supposed to be the solution here. If something is a valid 
thing to drop, it should have a type that can be accepted, and vice versa. 
Are there use cases where this doesn't work somehow?

> It's also incompatible with multi-touch. Although no multi-touch 
> implementation of the dnd spec currently exists (to my knowledge), the 
> spec does not preclude multiple simultaneous drags, so this may be a 
> concern in the future.

On Thu, 30 Aug 2012, Bronislav KluÄ~Mka wrote:
> If you want example of cross window, I can give you one, I was working 
> on administration, where certain information were presented using the 
> same DOM constructions but they can be inserted/placed in different 
> views so I've created the application as a set of iframes. But while 
> using D&D I've run into similar problem (I had a treeview of categories 
> and certain data from another iframe can be copied/moved to certain 
> nodes, not every data to every node), I had to solve it by putting data 
> information in drag data item type... Being able to access some complex 
> data in e.g. dragover event would be peachy

Could you elaborate on this? What information would you use in the 
dragover event that isn't just a type label? It seems to me like you'd 
just use the category as part of the type and then the datagrid would 
accept certain types in certain places.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list