[whatwg] Issue on drag & drop example in specification?

Shumpei Shiraishi shumpei.shiraishi at gmail.com
Mon Oct 26 01:53:16 PDT 2009


Hi, Ian.

I'm sorry for delay of replying and thanks for your post very much.

> Here you want to put the preventDefault() after the for() loop, so that it
> cancels the event only if the type was not found.

Mmm, it seems my mistake about understanding the specification...
For the example of section 7.9.1 (Drag and drop introduction), I have
understood that I should call preventDefault() in the dragenter event
when I want to *do* the dnd operation, but actually I should call
preventDefault() when I *don't* want to do, shouldn't I?

Here is the quote from the example in spec:
==========
  // cancel the event if the drag contains data of our type
  function dragEnterHandler(event) {
    // cancel the event if the drag contains data of our type
    if (event.dataTransfer.types.contains(internalDNDType))
      event.preventDefault();
  }
==========

And what I wanted to say is, "dnd operation is performed in spite of
omitting to call preventDefault() in dragenter event, so could I omit
to handle the dragenter event?".
I'm sorry about my example was hard to tell what I thought.

Kind regards.

--Shumpei



More information about the whatwg mailing list