Loading ...
Sorry, an error occurred while loading the content.
 

Can't figure out DragDrop targets

Expand Messages
  • wizfrob
    I m having a lot of trouble figuring out DragDrop targets. I m trying to make a simple app which lets a user drag thumbnail images from one area to another
    Message 1 of 22 , Mar 14, 2007
      I'm having a lot of trouble figuring out DragDrop targets.

      I'm trying to make a simple app which lets a user drag thumbnail
      images from one area to another area (both are divs) on a web page.

      I've set up each of the thumbnails in the source div as a DDProxy, and
      I can drag them around inside the source div with no problem. I've set
      the destination div as a DragDrop target, but then when I drag a
      thumbnail over it, it gets pushed out of the way and the thumbnail
      gets dropped beside it when I release the mouse button. I don't
      understand why "new YAHOO.util.DDTarget()" would make the destination
      div try to move aside for images I drag over it.

      I know I'm just doing something stupid, but the documentation on how
      to set up DragDrop seems really sparse, and the examples are hard to
      generalize to my situation. Are there any examples out there of what
      I'm trying to do, or any more detailed documentation on exactly how to
      set up a DragDrop app?
    • wizfrob
      I am still having a lot of trouble with drop targets. I d appreciate any help. My problem was that the onDragOver handler I wrote was doing an insertBefore no
      Message 2 of 22 , Mar 15, 2007
        I am still having a lot of trouble with drop targets. I'd appreciate
        any help.

        My problem was that the onDragOver handler I wrote was doing an
        insertBefore no matter what the object was being dragged over. I
        changed it to check to see if the item is being dragged over a drop
        target, and if so, it does an appendChild on the drop target. This
        solves my previous problem of the drop target moving out of the way
        and letting icons drop beside it rather than into it.

        My problem now is that when I specify a div as a DDTarget, and this
        div contains elements which are DDProxy objects, dragging another
        DDProxy over these elements causes chaos - they jump back and forth,
        making space for the dragged item then moving back to fill in that
        space. The problem is that sometimes the DDProxy divs are getting the
        onDragOver event, and sometimes the DDTarget is. I can't figure out
        how to tell it to ignore the DDTarget when I'm dragging an object over
        one of the divs inside the DDTarget.

        Has anyone else implemented a web site using the YUI DragDrop library?
        I could really use some examples of how to implement a DDTarget.
      • wizfrob
        The Sortable List demo at http://developer.yahoo.com/yui/examples/dragdrop/list.html allows a user to drag items between the two lists - but, if he drags
        Message 3 of 22 , Mar 17, 2007
          The "Sortable List" demo at "http://developer.yahoo.com/yui/examples/dragdrop/list.html"
          allows a user to drag items between the two lists - but, if he drags all of the items to one of
          the lists, he can never drag any items to the other list any more.

          Would someone please show me how to extend this sample application to let a user drag
          items into an empty list?
        • wizfrob
          ... http://developer.yahoo.com/yui/examples/dragdrop/list.html ... all of the items to one of ... to let a user drag ... I am still completely stuck on this,
          Message 4 of 22 , Mar 19, 2007
            --- In ydn-javascript@yahoogroups.com, "wizfrob" <brian@...> wrote:
            >
            > The "Sortable List" demo at
            "http://developer.yahoo.com/yui/examples/dragdrop/list.html"
            > allows a user to drag items between the two lists - but, if he drags
            all of the items to one of
            > the lists, he can never drag any items to the other list any more.
            >
            > Would someone please show me how to extend this sample application
            to let a user drag
            > items into an empty list?


            I am still completely stuck on this, and could really use a hand!

            I tried to extend the Sortable List demo app to show what I'm having
            trouble with. I edited list.html to add two lines to the DDApp init
            section, *above* the "new YAHOO.example.DDList" lines:

            new YAHOO.util.DDTarget("list1");
            new YAHOO.util.DDTarget("list2");

            And then I added "height: 200px; border: 1px solid black;" to the
            styles of both list elements so they would remain visible even when empty.

            Then, in DDList.js, I changed part of the onDragOver handler:

            if (id.substring(0,4) == "list") {
            destEl.appendChild(srcEl);
            } else if (this.goingUp) {
            p.insertBefore(srcEl, destEl);
            } else {
            p.insertBefore(srcEl, destEl.nextSibling);
            }

            Now I can drag items into an empty list, but the problem is that
            dragging an item into any list - populated or empty - will always
            deposit that item at the end of the list, and will not move around any
            other items present like the demo app used to do.

            Notice that if the two new DDTarget lines are ABOVE the six DDList
            lines, then dragging items over a list will make the list items jump
            around while I drag, and a dropped item will sometimes go into the
            proper place (but usually will end up at the end of the list). But if
            I put the two new DDTarget lines AFTER the six DDList lines, then the
            list items will not jump around, and a dropped item will always be
            inserted after them.

            What am I doing wrong here? All I want to do is know how to modify the
            sample demo list app to let me drag items into an empty target.
          • wizfrob
            I am guessing by the silence that the YUI DragDrop library is not being used very widely. :) As I continue to try to figure out this problem, I m getting very
            Message 5 of 22 , Mar 20, 2007
              I am guessing by the silence that the YUI DragDrop library is not
              being used very widely. :)

              As I continue to try to figure out this problem, I'm getting very
              strange results. I believe there's a bug involved with the way that
              onDragOver messages are being sent, and I'll file a bug report on
              sourceforge as soon as I can come up with a minimal test case.
            • wizfrob
              I ve filed bug 1685149 on this. http://sourceforge.net/tracker/index.php?func=detail&aid=1685149&group_id=165715&atid=836476 I d still really appreciate any
              Message 6 of 22 , Mar 21, 2007
                I've filed bug 1685149 on this.

                http://sourceforge.net/tracker/index.php?func=detail&aid=1685149&group_id=165715&atid=836476

                I'd still really appreciate any feedback from anyone who could let me
                know whether there's another way to get this to work. Is there a
                different forum where I should ask about problems with the Yahoo UI
                Toolkit?

                - B
              • Eric Miraglia
                Brian, Sorry there wasn t more feedback on your original note. What I ve done in the past to solve similar problems (dragging into negative space) is to make
                Message 7 of 22 , Mar 22, 2007
                  Brian,

                  Sorry there wasn't more feedback on your original note.

                  What I've done in the past to solve similar problems (dragging into negative space) is to make the list items draggable and then to make the containing space behind them a DDTarget.  If you get a drop or a mouseover on the background target but not on a list item, you can then make a decision about what to do.

                  There are other approaches, including inserting hidden elements at the top and/or bottom of the list, but all approaches involve creating elements that can be DDTargets that are not visible and draggable for the user.

                  Regards,
                  Eric


                  ______________________________________________
                  Eric Miraglia
                  Yahoo! User Interface Library



                  On Mar 21, 2007, at 9:39 AM, wizfrob wrote:

                  I've filed bug 1685149 on this.

                  http://sourceforge.net/tracker/index.php?func=detail&aid=1685149&group_id=165715&atid=836476

                  I'd still really appreciate any feedback from anyone who could let me
                  know whether there's another way to get this to work. Is there a
                  different forum where I should ask about problems with the Yahoo UI
                  Toolkit?

                  - B


                • wizfrob
                  ... Thank you. That s actually what I was trying to do, but then the containing space is the only thing that receives onDragOver messages, not the list items
                  Message 8 of 22 , Mar 23, 2007
                    --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
                    >
                    > Brian,
                    >
                    > Sorry there wasn't more feedback on your original note.
                    >
                    > What I've done in the past to solve similar problems (dragging into
                    > negative space) is to make the list items draggable and then to make
                    > the containing space behind them a DDTarget. If you get a drop or a
                    > mouseover on the background target but not on a list item, you can
                    > then make a decision about what to do.

                    Thank you. That's actually what I was trying to do, but then the
                    containing space is the only thing that receives onDragOver messages,
                    not the list items themselves. My code might be wrong, but I've
                    studied it up and down and it looks like it *should* work, so that's
                    why I filed a bug on it.

                    There seems to be a problem with the DragDrop library regarding
                    messages sent to nested dragdrop elements.

                    Can you show me any examples of what you've done, where items are
                    draggable and the containing space is a DDTarget? Have you run into
                    problems like I've hit? If I can see your code, maybe I can figure out
                    the proper way to do this.
                  • Eric Miraglia
                    Brian, We will update the Sortable List example in the next release to demonstrate this. In the meantime, if you post me a link to code you re currently
                    Message 9 of 22 , Mar 23, 2007
                      Brian,

                      We will update the Sortable List example in the next release to demonstrate this.  In the meantime, if you post me a link to code you're currently working with, I'll take a look and see if I can help you debug why the LIs' DD instances aren't having their events triggered as desired; in POINT mode, both the LIs and the containing DIV or UL instances should get triggered on each event.

                      Regards,
                      Eric

                      ______________________________________________
                      Eric Miraglia
                      Yahoo! User Interface Library



                      On Mar 23, 2007, at 5:46 AM, wizfrob wrote:

                      --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
                      >
                      > Brian,
                      >
                      > Sorry there wasn't more feedback on your original note.
                      >
                      > What I've done in the past to solve similar problems (dragging into
                      > negative space) is to make the list items draggable and then to make
                      > the containing space behind them a DDTarget. If you get a drop or a
                      > mouseover on the background target but not on a list item, you can
                      > then make a decision about what to do.

                      Thank you. That's actually what I was trying to do, but then the
                      containing space is the only thing that receives onDragOver messages,
                      not the list items themselves. My code might be wrong, but I've
                      studied it up and down and it looks like it *should* work, so that's
                      why I filed a bug on it.

                      There seems to be a problem with the DragDrop library regarding
                      messages sent to nested dragdrop elements.

                      Can you show me any examples of what you've done, where items are
                      draggable and the containing space is a DDTarget? Have you run into
                      problems like I've hit? If I can see your code, maybe I can figure out
                      the proper way to do this.


                    • wizfrob
                      ... Thank you for the offer of help! Actually, my code is based on the Sortable List demo (with modifications that didn t work, as described in the bug I
                      Message 10 of 22 , Mar 27, 2007
                        --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
                        >
                        > Brian,
                        >
                        > We will update the Sortable List example in the next release to
                        > demonstrate this. In the meantime, if you post me a link to code
                        > you're currently working with, I'll take a look and see if I can help
                        > you debug why the LIs' DD instances aren't having their events
                        > triggered as desired; in POINT mode, both the LIs and the containing
                        > DIV or UL instances should get triggered on each event.

                        Thank you for the offer of help!

                        Actually, my code is based on the Sortable List demo (with
                        modifications that didn't work, as described in the bug I logged), so
                        if you could show me the code to get Sortable List to work properly
                        with dragging items into an empty list, I'll go on that.

                        (I understand that you're planning on updating Sortable List in the
                        next release, but if there's anything you could show me now, I'd
                        really appreciate it!)

                        - B
                      • wizfrob
                        ... Or is there a new release imminent, with a new Sortable List demo app?
                        Message 11 of 22 , Mar 28, 2007
                          > if you could show me the code to get Sortable List to work properly
                          > with dragging items into an empty list, I'll go on that.

                          Or is there a new release imminent, with a new Sortable List demo app?
                        • wizfrob
                          The bug that I opened was closed with the comment: In POINT mode, you get two separate notifications for the dragover, one for the list, one for the list
                          Message 12 of 22 , Mar 29, 2007
                            The bug that I opened was closed with the comment: "In POINT mode, you
                            get two separate notifications for the dragover, one for the list, one
                            for the list item. The example inserts the source element during the
                            dragover, so once that happens you will only receive additional
                            notifications for the list (because you are no longer dragging over
                            another list item)."

                            But then if the list is the only thing that's getting onDragOver
                            notifications, how do I know whether this is because the user is
                            dragging over the element he just inserted into the list, or whether
                            this is because the user dragged the element into the empty area below
                            the list?

                            I am really eager to see the correct way to do this!
                          • Eric Miraglia
                            Brian, The release is coming, but in the meantime here s what Adam has cooking for the new Sortable List example:
                            Message 13 of 22 , Mar 29, 2007
                              Brian,

                              The release is coming, but in the meantime here's what Adam has cooking for the new Sortable List example:


                              Regards,
                              Eric


                              ______________________________________________
                              Eric Miraglia
                              Yahoo! User Interface Library



                              On Mar 28, 2007, at 11:31 AM, wizfrob wrote:

                              > if you could show me the code to get Sortable List to work properly
                              > with dragging items into an empty list, I'll go on that.

                              Or is there a new release imminent, with a new Sortable List demo app?


                            • wizfrob
                              ... Thank you very much for showing me that example! I see that it does its thing by ignoring all events that happen on the DDTarget itself unless the
                              Message 14 of 22 , Mar 30, 2007
                                --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
                                > The release is coming, but in the meantime here's what Adam has
                                > cooking for the new Sortable List example:
                                > http://yuiblog.com/sandbox/yui/v220/examples/dragdrop/sortablelist.html

                                Thank you very much for showing me that example! I see that it does
                                its thing by ignoring all events that happen on the DDTarget itself
                                unless the DDTarget is empty.

                                The problem with that approach, however, is that dragging into the
                                empty area below list items will not count as a drag, and the item
                                will spring back to its previous position. This is counterintuitive
                                and will confuse users - if there's only one item in a list, then it's
                                impossible to drag anything else into the list unless the user knows
                                he's supposed to drag the new item *onto* the existing item.

                                The core of the problem is that when I drag an item into a DDTarget,
                                then the DDTarget always gets the onDragOver message even if I'm
                                actually dragging over one of the DD elements in the target. So, the
                                target has no way of knowing whether itself is the target of the drop,
                                or whether one of its elements is.
                              • Eric Miraglia
                                Brian, That s a fair criticism. Note, though, that these events happen in a reliable order based on the order in which you defined your DD instances. If you
                                Message 15 of 22 , Mar 30, 2007
                                  Brian,

                                  That's a fair criticism.

                                  Note, though, that these events happen in a reliable order based on the order in which you defined your DD instances.  If you define your DDTarget — your background/container — last, it will get the onDragDrop event last as well.  So you can set a flag in your onDragDrop to identify whether or not a list item was hit.  If you get onDragDrop firing on the background without hitting an <li> first, you know that you need to handle this from the background/container element.  Here's a crude hack of how to track the logic (using console.log() here, so this code won't play in IE -- use Firefox with Firebug to watch the log messages):

                                  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
                                  <html>
                                  <head>

                                  </head>
                                  <body>
                                  <script type="text/javascript" src="http://yui.yahooapis.com/2.2.0/build/utilities/utilities.js"></script>
                                  <style>
                                  #ddUl {width:5em; height:10em; border:1px solid red;}
                                  .ddLi {height:3em; border:1px solid green;}
                                  </style>
                                  <script>
                                  var ddLi1 = new YAHOO.util.DD("ddLi1");
                                  var ddLi2 = new YAHOO.util.DD("ddLi2");
                                  var ddUl = new YAHOO.util.DDTarget("ddUl");
                                  var startDrag = function(x, y) {
                                  this.dropOnLi = false;
                                  }
                                  var onDragDrop = function(e, id) {
                                  console.log("onDragDrop with target of " + id);
                                  if(YAHOO.util.Dom.get(id).nodeName.toLowerCase() == "li") {
                                  this.dropOnLi = true;
                                  } else {
                                  if (!this.dropOnLi) {
                                  console.log("You've dropped the LI on the background element directly.");
                                  }
                                  }
                                  }
                                  //do this by subclassing...
                                  ddUl.startDrag = ddLi1.startDrag = ddLi2.startDrag = startDrag;
                                  ddUl.onDragDrop = ddLi1.onDragDrop = ddLi2.onDragDrop = onDragDrop;
                                  </script>
                                  <ul id="ddUl">
                                  <li class="ddLi" id="ddLi1">Item One</li>
                                  <li class="ddLi" id="ddLi2">Item Two</li>
                                  </ul>
                                  </body>
                                  </html>

                                  Regards,
                                  Eric


                                  ______________________________________________
                                  Eric Miraglia
                                  Yahoo! User Interface Library



                                  On Mar 30, 2007, at 5:52 AM, wizfrob wrote:

                                  --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
                                  > The release is coming, but in the meantime here's what Adam has
                                  > cooking for the new Sortable List example:
                                  > http://yuiblog.com/sandbox/yui/v220/examples/dragdrop/sortablelist.html

                                  Thank you very much for showing me that example! I see that it does
                                  its thing by ignoring all events that happen on the DDTarget itself
                                  unless the DDTarget is empty.

                                  The problem with that approach, however, is that dragging into the
                                  empty area below list items will not count as a drag, and the item
                                  will spring back to its previous position. This is counterintuitive
                                  and will confuse users - if there's only one item in a list, then it's
                                  impossible to drag anything else into the list unless the user knows
                                  he's supposed to drag the new item *onto* the existing item.

                                  The core of the problem is that when I drag an item into a DDTarget,
                                  then the DDTarget always gets the onDragOver message even if I'm
                                  actually dragging over one of the DD elements in the target. So, the
                                  target has no way of knowing whether itself is the target of the drop,
                                  or whether one of its elements is.


                                • Gopalarathnam Venkatesan
                                  ... Brian, You can download FireBug lite to inspect log messages using console.log() on browsers like IE, Safari, Opera. http://www.getfirebug.com/lite.html --
                                  Message 16 of 22 , Mar 30, 2007
                                    Eric Miraglia wrote:
                                    >
                                    >
                                    > Brian,
                                    >
                                    >
                                    > That's a fair criticism.
                                    >
                                    > Note, though, that these events happen in a reliable order based on the
                                    > order in which you defined your DD instances. If you define your
                                    > DDTarget — your background/container — /last/, it will get the
                                    > onDragDrop event last as well. So you can set a flag in your onDragDrop
                                    > to identify whether or not a list item was hit. If you get onDragDrop
                                    > firing on the background without hitting an <li> first, you know that
                                    > you need to handle this from the background/container element. Here's a
                                    > crude hack of how to track the logic (using console.log() here, so this
                                    > code won't play in IE -- use Firefox with Firebug to watch the log
                                    > messages):
                                    >

                                    Brian,

                                    You can download FireBug lite to inspect log messages using
                                    console.log() on browsers like IE, Safari, Opera.

                                    http://www.getfirebug.com/lite.html

                                    --
                                    Gopalarathnam Venkatesan

                                    http://gopalarathnam.com/
                                  • wizfrob
                                    ... I appreciate the help! I want to define my DDTargets first, actually, because my DDProxys are defined dynamically. I could go through a dance of
                                    Message 17 of 22 , Mar 30, 2007
                                      --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
                                      > Note, though, that these events happen in a reliable order based on
                                      > the order in which you defined your DD instances. If you define your
                                      > DDTarget � your background/container � last, it will get the
                                      > onDragDrop event last as well. So you can set a flag in your
                                      > onDragDrop to identify whether or not a list item was hit. If you
                                      > get onDragDrop firing on the background without hitting an <li>
                                      > first, you know that you need to handle this from the background/
                                      > container element.

                                      I appreciate the help!

                                      I want to define my DDTargets first, actually, because my DDProxys are
                                      defined dynamically. I could go through a dance of unregistering the
                                      targets then reregistering them each time a new DDProxy is created,
                                      but I'd prefer not to have to...

                                      I'll look into the approach of using a flag to remember whether the
                                      DDProxy was just dragged over a contained element before the target
                                      got the message, but I'm not sure whether this would work reliably
                                      with onDragOver messages and unpredictable users.

                                      I'm curious - what's the reasoning behind sending duplicate messages
                                      to each DD element behind the one actually being dragged over? If the
                                      foremost element captures the message and does something with it,
                                      couldn't the choice be left up to this element whether or not to
                                      continue to pass the message up the line?

                                      Or, alternately, is there any way to stop the message propagation, so
                                      that the containing element won't be given the message?

                                      Again, thank you for your help!

                                      - B
                                    • The Mechanical Ruins
                                      Hi, Building off the DDList example, it s possible to add a class to your sortable items, letting onDragOver decide if the id was a sortable object or a
                                      Message 18 of 22 , Mar 30, 2007
                                        Hi,

                                        Building off the DDList example, it's possible to add a class to your
                                        sortable items, letting onDragOver decide if the id was a sortable
                                        object or a droppable container (I couldn't find a way to detect the
                                        dd Type). That would then simplify the onDragOver logic to:

                                        Is this a list item: if so, hold onto the id, treat like normal DDList

                                        Is this a target: if so, look at the last list item you dragged over.
                                        Do an isAncestor check to see if you've changed columns (without
                                        passing over any list items), and appendChild.

                                        http://www.felocity.org/media/2007/03/30-sortable_column/ (code is a
                                        bit large to paste to ML) This is a working example with some
                                        listeners set up just to resize the 3 columns to the viewport size
                                        during the drag operation. The only thing I'm really hung up on is a
                                        better way to detect a DDTarget v the sortable item. Adding a class
                                        and doing hasClass adds a non-standard property to the config object,
                                        something I'd rather avoid if at all possible. Has anyone had any
                                        experience with isTypeOfDD()? It seems like it should fill that last
                                        missing piece.

                                        ---
                                        Jakob Heuser




                                        --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
                                        >
                                        > If you define your
                                        > DDTarget — your background/container — last, it will get the
                                        > onDragDrop event last as well. So you can set a flag in your
                                        > onDragDrop to identify whether or not a list item was hit. If you
                                        > get onDragDrop firing on the background without hitting an <li>
                                        > first, you know that you need to handle this from the background/
                                        > container element.
                                        >
                                        [snip]example
                                        >
                                        >
                                        > ______________________________________________
                                        > Eric Miraglia
                                        > Yahoo! User Interface Library
                                        >
                                        >
                                        >
                                        > On Mar 30, 2007, at 5:52 AM, wizfrob wrote:
                                        >
                                        > >
                                        > > The core of the problem is that when I drag an item into a DDTarget,
                                        > > then the DDTarget always gets the onDragOver message even if I'm
                                        > > actually dragging over one of the DD elements in the target. So, the
                                        > > target has no way of knowing whether itself is the target of the drop,
                                        > > or whether one of its elements is.
                                        > >
                                        > >
                                        > >
                                        >
                                      • wizfrob
                                        When I drag a DD item over another DD item that s contained by a DDTarget, why does the DDTarget receive copies of the drag events that are sent to the element
                                        Message 19 of 22 , Apr 4 6:21 AM
                                          When I drag a DD item over another DD item that's contained by a
                                          DDTarget, why does the DDTarget receive copies of the drag events that
                                          are sent to the element I'm dragging over?

                                          This behavior is causing me to have to come up with some ugly
                                          workarounds, because when the container receives an event I don't know
                                          whether this is because the user is dragging over it or over something
                                          in it.

                                          I'm curious to know the reasoning behind this design decision, and
                                          what situations are made easier by this double-event behavior.
                                        • Adam Moore
                                          ... INTERSECT mode was added in part to handle the issue with stacked items, and it was thought at the time that INTERSECT mode would replace POINT mode. That
                                          Message 20 of 22 , Apr 4 11:02 AM
                                            On Wed, Apr 04, 2007 at 01:21:23PM -0000, wizfrob wrote:
                                            > When I drag a DD item over another DD item that's contained by a
                                            > DDTarget, why does the DDTarget receive copies of the drag events that
                                            > are sent to the element I'm dragging over?

                                            INTERSECT mode was added in part to handle the issue with stacked items,
                                            and it was thought at the time that INTERSECT mode would replace POINT
                                            mode. That didn't turn out to be the case, as many implementations are
                                            easier to work with in POINT mode. The next release will have have a
                                            feature to make it easier to work with stacked items in POINT mode.

                                            > This behavior is causing me to have to come up with some ugly
                                            > workarounds, because when the container receives an event I don't know
                                            > whether this is because the user is dragging over it or over something
                                            > in it.

                                            If you have to resort to ugly workarounds, submitting a bug report will
                                            help us address it:

                                            http://sourceforge.net/tracker/?func=add&group_id=165715&atid=836476

                                            -Adam
                                          • wizfrob
                                            ... I d be happy to submit a bug report (and, in fact, I previously did: (bug 1685149, which was closed because the behavior in question was as designed), but
                                            Message 21 of 22 , Apr 5 5:50 AM
                                              --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...> wrote:
                                              > If you have to resort to ugly workarounds, submitting a bug report will
                                              > help us address it:
                                              >
                                              > http://sourceforge.net/tracker/?func=add&group_id=165715&atid=836476

                                              I'd be happy to submit a bug report (and, in fact, I previously did:
                                              (bug 1685149, which was closed because the behavior in question was as
                                              designed), but what would you like me to include? Are you saying I
                                              should open a bug listing some of the ugly workarounds to find out
                                              whether the drag events to the container are copies or originals?

                                              The workarounds have been given by other people here on this mailing
                                              list over the past few days. Here are three I've seen:

                                              http://tech.groups.yahoo.com/group/ydn-javascript/message/11584
                                              http://tech.groups.yahoo.com/group/ydn-javascript/message/11601
                                              http://tech.groups.yahoo.com/group/ydn-javascript/message/10940
                                            • wizfrob
                                              ... The workaround you provided in bug 1700201 ( http://sourceforge.net/tracker/index.php?func=detail&aid=1700201&group_id=165715&atid=836476 ) kind of
                                              Message 22 of 22 , Apr 23 6:22 AM
                                                --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...> wrote:
                                                >
                                                > On Wed, Apr 04, 2007 at 01:21:23PM -0000, wizfrob wrote:
                                                > > When I drag a DD item over another DD item that's contained by a
                                                > > DDTarget, why does the DDTarget receive copies of the drag events that
                                                > > are sent to the element I'm dragging over?
                                                >
                                                > INTERSECT mode was added in part to handle the issue with stacked items,
                                                > and it was thought at the time that INTERSECT mode would replace POINT
                                                > mode. That didn't turn out to be the case, as many implementations are
                                                > easier to work with in POINT mode. The next release will have have a
                                                > feature to make it easier to work with stacked items in POINT mode.
                                                >
                                                > > This behavior is causing me to have to come up with some ugly
                                                > > workarounds, because when the container receives an event I don't know
                                                > > whether this is because the user is dragging over it or over something
                                                > > in it.
                                                >
                                                > If you have to resort to ugly workarounds, submitting a bug report will
                                                > help us address it:
                                                >
                                                > http://sourceforge.net/tracker/?func=add&group_id=165715&atid=836476
                                                >
                                                > -Adam
                                                >


                                                The workaround you provided in bug 1700201
                                                ("http://sourceforge.net/tracker/index.php?func=detail&aid=1700201&group_id=165715&atid=836476")
                                                kind of qualifies as an "ugly workaround" to me. It seems as if
                                                there's a lot of effort being made to figure out whether the DDM
                                                messages being received should be ignored or not.

                                                If only there were a single message sent to the DD element being
                                                directly affected - and that element then had a choice whether to send
                                                the message down the line - that would simplify the code a lot.

                                                I haven't worked with INTERSECT mode, but from your comment above it
                                                sounds like you're acknowledging that the multiple-messages approach
                                                isn't as appropriate for POINT mode. Is there any chance in a future
                                                release that, if the DDM is in POINT mode, it could just send a single
                                                event instead of several copies of that event?
                                              Your message has been successfully submitted and would be delivered to recipients shortly.