Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8430 closed bug (fixed)

draggable with sortable makes sortable event "receive" triggered wrong

Reported by: yuan Owned by: yuan
Priority: minor Milestone: 1.8.22
Component: ui.draggable Version: 1.8.21
Keywords: Cc:
Blocked by: Blocking:

Description

When draggable element connect with sortable element, the bug may appear, the event for receive of sortable may be triggered twice, one stand for "fromOutside", one not.

How to repoduce:

First, drag one draggable element to sortable container, drag it into container(name it "C"), then put it back. Now, if you drag one element from container "C" to another sortable container. Then you could find the event "receive" trigged twice.

Test case: http://jsfiddle.net/wedgwood/qmDnz/4/

Change History (8)

comment:1 Changed 4 years ago by yuan

I have fixed it with pull request https://github.com/jquery/jquery-ui/pull/692.

comment:2 follow-up: Changed 4 years ago by scottgonzalez

  • Owner set to yuan
  • Status changed from new to pending

I can't reproduce this. Your steps seem to be impossible to follow. Specifically "then put it back," since you can not drag the item back to the column of draggables.

comment:3 in reply to: ↑ 2 Changed 4 years ago by wedgwood

Replying to scott.gonzalez:

I can't reproduce this. Your steps seem to be impossible to follow. Specifically "then put it back," since you can not drag the item back to the column of draggables.

You could reproduce it, if you follow steps below:

First, you drag one draggable item over the first sortable container (do not mouseout).

After you see the grey placeholder, you may continue to move the draggable item down to make it between first and second sortable container to make draggable item not be contained by any of them (i.e. you could not see the placeholder). Then, do mouseout.

Now, you could move one sortable item from first container to any other sortable item. You will find the receive event trigged twice(one stand for "from draggable", one stand for "from sortable").

comment:4 Changed 4 years ago by scottgonzalez

  • Status changed from pending to open

Thanks for the more detailed explanation. I'm able to reproduce this and confirm that your patch fixes it.

comment:5 Changed 4 years ago by Baoju Yuan

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

Sortable: Reset fromOutside property when canceling helper removal. Fixes #8430 - draggable with sortable makes sortable event receive triggered wrong.

Changeset: dcea4f043adc7f37674feead31ded148d311ab72

comment:6 Changed 4 years ago by Baoju Yuan

Sortable: Reset fromOutside property when canceling helper removal. Fixes #8430 - draggable with sortable makes sortable event receive triggered wrong. (cherry picked from commit dcea4f043adc7f37674feead31ded148d311ab72)

Changeset: 347aa335f001c6e80e6670c90c6262a358b89932

comment:7 Changed 4 years ago by scottgonzalez

  • Milestone changed from 1.9 to 1.8.22

comment:8 Changed 4 years ago by jjoemb

I believe this also fixes #8162

Note: See TracTickets for help on using tickets.