W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

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

From: Shumpei Shiraishi <shumpei.shiraishi@gmail.com>
Date: Mon, 26 Oct 2009 17:53:16 +0900
Message-ID: <104ce6580910260153i934fb51ged008f226d73916@mail.gmail.com>
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
Received on Monday, 26 October 2009 01:53:16 UTC

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