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

Can't drag drop an anchor with Yui3

Expand Messages
  • jamesb.orion
    Using the new yui3 drag and drop module and I ve found that when the element I m trying to drag is an anchor, I can t drag it. If the element being dragged is
    Message 1 of 4 , Aug 3, 2009
    View Source
    • 0 Attachment
      Using the new yui3 drag and drop module and I've found that when the element I'm trying to drag is an anchor, I can't drag it. If the element being dragged is say a div that contains an anchor, you can't drag it by clicking and dragging on the anchor itself (unless the element has already been dragged by somewhere else in the element).

      I've been trying to create a draggable tab view by combining yui2 tab view and yui3 everything else but this is holding me back (as tab's are essentially styled anchors).

      I've checked the bug list and this message group and haven't seen anything on this, has anyone else experienced this problem? Or can anyone suggest a workaround? I've only tested this on firefox 3.5 and chromium on Linux x64.
    • Dav Glass
      By default A tags are in the invalidHandle list.. Just remove it when you create the dd instance: var dd = new Y.DD.Drag({ node: #drag }).removeInvalid( a );
      Message 2 of 4 , Aug 3, 2009
      View Source
      • 0 Attachment
        By default A tags are in the invalidHandle list.. Just remove it when
        you create the dd instance:

        var dd = new Y.DD.Drag({
        node: '#drag'
        }).removeInvalid('a');

        That should do it..
        Dav

        On Mon, 03 Aug 2009, jamesb.orion wrote:

        > Using the new yui3 drag and drop module and I've found that when the element I'm trying to drag is an anchor, I can't drag it. If the element being dragged is say a div that contains an anchor, you can't drag it by clicking and dragging on the anchor itself (unless the element has already been dragged by somewhere else in the element).
        >
        > I've been trying to create a draggable tab view by combining yui2 tab view and yui3 everything else but this is holding me back (as tab's are essentially styled anchors).
        >
        > I've checked the bug list and this message group and haven't seen anything on this, has anyone else experienced this problem? Or can anyone suggest a workaround? I've only tested this on firefox 3.5 and chromium on Linux x64.
        >

        --
        Dav Glass
        davglass@...
        blog.davglass.com


        + Windows: n. - The most successful computer virus, ever. +
        + A computer without a Microsoft operating system is like a dog
        without bricks tied to its head +
        + A Microsoft Certified Systems Engineer is to computing what a
        McDonalds Certified Food Specialist is to fine cuisine +
      • jamesb.orion
        ... Thanks Dav that did the trick. If the anchor tag is meant to be invalid tho, then maybe the following behavior I observed is a bug: you can t drag it [the
        Message 3 of 4 , Aug 3, 2009
        View Source
        • 0 Attachment
          --- In yui3@yahoogroups.com, Dav Glass <davglass@...> wrote:
          >
          > By default A tags are in the invalidHandle list.. Just remove it when
          > you create the dd instance:
          >
          > var dd = new Y.DD.Drag({
          > node: '#drag'
          > }).removeInvalid('a');
          >
          > That should do it..
          > Dav

          Thanks Dav that did the trick.

          If the anchor tag is meant to be invalid tho, then maybe the following behavior I observed is a bug:
          "you can't drag it [the drag element] by clicking and dragging on the anchor itself (unless the element has already been dragged by somewhere else in the element)." I found that if I dragged somewhere else in the drag element and then tried to drag the anchor it would sometimes let me drag the anchor.

          Let me know if you'd like me to raise a bug.

          Thanks for the help!
          James
        • Dav Glass
          I wouldn t think it s a bug. It s just a bad idea in general to drag a link. Since it has a default action to it, most browsers freak out about it.. If you can
          Message 4 of 4 , Aug 3, 2009
          View Source
          • 0 Attachment
            I wouldn't think it's a bug. It's just a bad idea in general to drag a
            link. Since it has a default action to it, most browsers freak out about
            it..

            If you can put together a complete 100% reproducible test case for it,
            then file a bug and I will look into it..

            Dav

            On Tue, 04 Aug 2009, jamesb.orion wrote:

            > --- In yui3@yahoogroups.com, Dav Glass <davglass@...> wrote:
            > >
            > > By default A tags are in the invalidHandle list.. Just remove it when
            > > you create the dd instance:
            > >
            > > var dd = new Y.DD.Drag({
            > > node: '#drag'
            > > }).removeInvalid('a');
            > >
            > > That should do it..
            > > Dav
            >
            > Thanks Dav that did the trick.
            >
            > If the anchor tag is meant to be invalid tho, then maybe the following behavior I observed is a bug:
            > "you can't drag it [the drag element] by clicking and dragging on the anchor itself (unless the element has already been dragged by somewhere else in the element)." I found that if I dragged somewhere else in the drag element and then tried to drag the anchor it would sometimes let me drag the anchor.
            >
            > Let me know if you'd like me to raise a bug.
            >
            > Thanks for the help!
            > James
            >

            --
            Dav Glass
            davglass@...
            blog.davglass.com


            + Windows: n. - The most successful computer virus, ever. +
            + A computer without a Microsoft operating system is like a dog
            without bricks tied to its head +
            + A Microsoft Certified Systems Engineer is to computing what a
            McDonalds Certified Food Specialist is to fine cuisine +
          Your message has been successfully submitted and would be delivered to recipients shortly.