Bug Tracker

Modify

Ticket #2441 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

'missing' over event with nested droppables

Reported by: StrikerNL Owned by: codesquare
Priority: minor Milestone: 1.2.4
Component: ui Version: 1.2.3
Keywords: droppable over event Cc:
Blocking: Blocked by:

Description

There seems to be a bug in droppable, when multiple divs are nested and droppable.

The over event for a parent droppable only gets called once; it doesn't seem to get called when one moves into a child droppable and back into the parent droppable.

The out event for the child does get called. One could, using this, keep track of the droppables that are currently in an 'over' state, and so know when the draggable has moved back into the parent droppable.

Maybe this is by design, it doesn't make for convenient coding however.

My suggestion is to either make the over event be triggered when a draggable leaves a child droppable into a parent droppable, or make it a behaviour option.

I have created a testcase which can be found at  http://ddcrew-dev.be/droppable/ (also attached as droppable.zip).

The left frame shows the situation as it is now, the right frame shows how I'd prefer it to be. To test it, simply drag the draggable over the droppables and observe the 'over' and 'out' events that get called.

The code I wrote to make the 'fixed' version can be found in  ui.droppable.fixed.js. I have also included a patch against jquery ui 1.5b ( droppable.patch). I'm not sure if it's good enough for inclusion, someone more expert will have judge that.

Thanks for this great jquery plugin and your time!

Attachments

droppable.zip Download (40.7 KB) - added by StrikerNL 5 years ago.
Testcase

Change History

Changed 5 years ago by StrikerNL

Testcase

comment:1 Changed 5 years ago by paul

  • Owner changed from paul to StrikerNL

I cannot reproduce your issue with the test case you have on your server - can you recheck please? Both sides work exactly the same for me and report all states.

comment:2 Changed 5 years ago by StrikerNL

That is odd, what browser are you using?

When I use the left frame, dragging the purple div over the red one into the yellow one and back out again I get these events (newest first):

leaving outermost
leaving inner
moving into inner
moving into outermost

Same for the right frame:

leaving outermost
moving into outermost
leaving inner
moving into inner
moving into outermost

The missing "moving into outermost" in the left frame is what I'm talking about.

comment:3 Changed 5 years ago by paul

  • Owner changed from StrikerNL to codesquare

comment:4 Changed 5 years ago by scott.gonzal

  • Status changed from new to closed
  • Resolution set to fixed

I think the current behavior makes sense for standard droppables. See #2571 for the commits that fixed this for greedy droppables.

If you feel that this behavior should exist for standard droppables, please reopen this ticket.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.