[ 3 posts ]

Iliyan Peychev

YUI Contributor

  • Username: peychevi
  • Joined: Tue Feb 24, 2009 12:38 pm
  • Posts: 136
  • Location: Varna, Bulgaria
  • Twitter: ipeychev
  • GitHub: ipeychev
  • Gists: ipeychev
  • Offline
  • Profile
Tags:

Drag&Drop fires enter and exit events out of order

Post Posted: Wed Dec 07, 2011 4:33 pm
+0-
Hello,

There is an issue with Drag&Drop when applied to table rows. In this case we receive enter and exit events out of order.

Here is an example:
Let's suppose we have a table with three rows. We are using delegate and we have set drop targets to each tr element.
We drag the third row over the second one, then over the first one.

In this case we receive the following events:
drag:enter
drag:enter
drag:exit

And they should be:
drag:enter
drag:exit
drag:enter

What is interesting is that if we set drop targets to some of the elements in the table cells, this works fine. I think this is due to the fact that they have some space between (padding), but the rows don't.

I also tried to use different dragMode without success.

Is that known issue? Does someone have an idea?

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: Drag&Drop fires enter and exit events out of order

Post Posted: Thu Dec 08, 2011 5:45 am
+0-
DD can support hovering over more than one element at a time, it sounds like the tr's are overlapping slightly so the targets are overlapping. You can try setting the padding config on the Drop Target's to a -1px or -2px to force them a little smaller.

http://yuilibrary.com/yui/docs/api/clas ... tr_padding

Iliyan Peychev

YUI Contributor

  • Username: peychevi
  • Joined: Tue Feb 24, 2009 12:38 pm
  • Posts: 136
  • Location: Varna, Bulgaria
  • Twitter: ipeychev
  • GitHub: ipeychev
  • Gists: ipeychev
  • Offline
  • Profile

Re: Drag&Drop fires enter and exit events out of order

Post Posted: Thu Dec 08, 2011 10:42 pm
+0-
Thanks Dav, -1 did the trick.
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum