Skip to content

Fixed UI glitch that made dragging between connected sortables an ugly affair.#637

Closed
courthead wants to merge 1 commit intojquery:masterfrom
courthead:master
Closed

Fixed UI glitch that made dragging between connected sortables an ugly affair.#637
courthead wants to merge 1 commit intojquery:masterfrom
courthead:master

Conversation

@courthead
Copy link
Contributor

This makes using connected sortables a much more pleasant and predictable experience for users. This is also my first ever edit to a project on GitHub, so apologies in advance for the 20+ things I probably didn't do correctly.

…tion variable when inserting an item into a different sortable. Fixed #8268 - Items may not be inserted into the correct position when dragged between connected sortables
@gnarf
Copy link
Member

gnarf commented Apr 22, 2012

Is there a ticket / test case for this issue?

@courthead
Copy link
Contributor Author

http://bugs.jqueryui.com/ticket/8268

The easiest way to test it is using the jQuery UI demo for connected sortables. Try dragging an item from one list into the top of the other list: http://jqueryui.com/demos/sortable/#connect-lists

@scottgonzalez
Copy link
Member

Shouldn't this use refreshPositions()?

@courthead
Copy link
Contributor Author

I considered using refreshPositions(), but it didn't work because that function has an if-statement designed to "ignore calculating positions of all connected containers when we're not over them". So refreshing positions before dragging an item into a new container doesn't help here. Of course, I could always add a flag in the form of an optional argument that disables that particular if-statement. Do you think that would be a cleaner solution?

@scottgonzalez
Copy link
Member

Sorry for the delayed response. I think the logic would be better if it went through refreshPositions() but honestly the code isn't very clean to begin with. I'll land this as is. Thanks.

@scottgonzalez
Copy link
Member

Landed in c42bdce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants