Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#8809 closed bug (fixed)

Draggable: Position issue when connected to sortable

Reported by: domnulnopcea Owned by: mikesherov
Priority: minor Milestone: 1.11.2
Component: ui.draggable Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

I attach a test case. just try to drag the column by the string "aaaa"

http://jsfiddle.net/domnulnopcea/fx4L4/1/

Change History (13)

comment:1 Changed 4 years ago by scottgonzalez

  • Component changed from ui.core to ui.draggable

@domnulnopcea It would be really helpful if you could provide better descriptions and more reduced test cases in the future. For example, nowhere in this ticket do you even mention the use of sortable, or any of the dozen options you're using in the fiddle. The markup also contains a ton of classes, ids, and elements unrelated to the bug.

I've reduced the fiddle a bit, but it would be great if you could take some time and reduce the styles to the bare minimum that still shows the problem: http://jsfiddle.net/fx4L4/2/ I've also removed everything in the JS section that was unrelated to the bug. This bug appears when an element is both sortable and draggable, and is being dragged.

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

an even more reduced jsfiddle

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

Replying to domnulnopcea:

an even more reduced jsfiddle

If you had intended to leave a link to a new fiddle, I think you forgot to paste it.

comment:5 in reply to: ↑ 4 Changed 4 years ago by scottgonzalez

comment:6 Changed 4 years ago by scottgonzalez

  • Milestone changed from 1.10.0 to 2.0.0
  • Status changed from new to open
  • Summary changed from dragged columns fly to top of the screen to Draggable: Position issue when connected to sortable

comment:7 follow-up: Changed 4 years ago by domnulnopcea

is this going to be ever taken into account for fixing?

comment:8 in reply to: ↑ 7 Changed 4 years ago by tj.vantoll

Replying to domnulnopcea:

is this going to be ever taken into account for fixing?

As Scott mentioned, in 1 reducing the test case would go a long ways towards helping us understand this issue. As is we're unlikely to look into this before our interactions rewrite, currently planned for 1.13. We'd be happy to review a pull request though.

comment:9 Changed 3 years ago by mikesherov

  • Milestone changed from 2.0.0 to none

This happens because the element switches to "position:absolute" from "position:relative" once it connects: http://jsfiddle.net/fx4L4/39/

This causes the draggable to have the wrong "position" while at the same time the sortable version of the same element have the correct position. One potential solution is to set the draggable's position to the sortable's position while it's connected, but I still need to figure out how to revert that should the user pull the item out of the sortable before ever letting go on the initial drag. :-\

comment:10 Changed 3 years ago by mikesherov

comment:11 Changed 3 years ago by mikesherov

  • Owner set to mikesherov
  • Status changed from open to assigned

comment:12 Changed 3 years ago by Mike Sherov

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

Draggable: No cloning in connectToSortable and ensure correct position

Draggables now forcefully recalculate their position when dragged out of a sortable. Sortables now override draggable position when a draggable is dragged into it. Lastly, no longer remove sortable helper when dragging a draggable out, which allows us to not use a clone.

Fixes #7734 Fixes #8809 Closes gh-1322

Changeset: 95546c5d045f8055b121f24d3e35468e2a570c1b

comment:13 Changed 3 years ago by mikesherov

  • Milestone changed from none to 1.11.2
Note: See TracTickets for help on using tickets.