-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sortable Fix-Up #1793
Sortable Fix-Up #1793
Conversation
* Created _scroll extension point and migrated scroll code from _mouseDrag * Cleaned up logic for scrolled * Fixed appendTo functionality to match documentation * Remove unnecessary function calls * Move set-up position functions to appropriate place * Base scrollParent on placeholder and not helper * Update scrollParent when switching containers
* Fixed misplaced merge lines
* Fixed code style issues
* Fixed code style issue
* Removed scrollParent placeholder basis due to unknown difference between local copy and pushed copy functionality
* Fixed merge issue with position of _getParentOffset() and reinstated scrollParent based on placeholder
* Restored _mouseDrag call from _mouseStart
Woo Hoo! |
Can you please link to the bugs you're fixing? |
Scott, |
* Fix item intersection after scroll
No problem. Don't worry about closing it if you don't get to it by this weekend. If it sits for a long time with no responses, we'll close it, but a few days is not a problem at all :-) |
* Update offset as well when moving from sortable with no scrollbar to a sortable with scroll bar * No need to process mouse drag if not in a container
Scott, |
* Missing update of absolute position left component via scroll action
* Scroll values were slightly different from offset values for items so reverted to using offset to update item positions after scroll * Created entry for dragDirection to reduce superflous function calls * Removed unneeded code give fix-up for offsetParent
* Worked refreshItemPositions function into existing refreshPosition function
Fix it this bug too? https://bugs.jqueryui.com/ticket/15097 |
@Daijobou I can't say for certain that I have addressed issue(s) specific to #15097 but I did make some rearrangements and changes that most certainly affect performance. Beyond what I have committed here, I have further changes that target other scrollable related issues as well as addressing autoscrolling, but I did not provide these here as they are fairly far a field from what I would consider the jQuery ui standard. (They did make the client fairly happy, however.) You are welcome to try the changes presented on your own and see how they impact performance. Any feedback you may be able to provide is always appreciated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@borgboyone If you don't see any existing tickets for bugs that this fixes, can you please file a new ticket so that this will show up in the changelog?
You're right that these changes are disconcerting due to the age of the code (and the lack of anyone willing to own this code). However, if you're willing to own just this change and deal with any regressions that are reported as a result of this change, we can merge this.
@scottgonzalez I had completely let this get away from me. I have made time tomorrow evening to create the tickets necessary for the changelog and post them here once completed. Gotta dig up those notes. That's fine on the regression. I don't foresee that these changes could generate new issues. The only thing I could potentially see an issue with is if someone has attempted to fix them via callbacks previous and then introduce these changes leading to conflict. Something to consider given what I've seen others attempt on StackOverflow. I'm assuming you have looked over these changes? Did you see anything that concerned you? If you're so inclined, check out: https://github.com/borgboyone/jQuery-UI-ScrollPane/blob/master/src/jquery-ui-scrollsortable-autoscroll.js It's not a version I would recommend for the main stream, but it has some tidbits you might find interesting and it essentially "fixes" the scrollbar movement issue associated with the non atomic operation of absolute positioning (popping out) of the helper and dropping in the placeholder. I just wish I had been able to find a proper solution to that problem. |
I've looked over the changes and I didn't see anything that concerned me. We've just had a lot of regressions in the interaction widgets over time, due to their age and smaller test coverage. |
Thanks for filing all of those tickets. I see that a lot of them have placeholders for fiddles and SO discussions. Are you planning on filling those in or should they just be removed? |
@scottgonzalez I do plan on filling those in and listing them here with corresponding line numbers this evening. |
@scottgonzalez #3173: (1106-1114) #15165: (353-401, 426) #15166: (429, 852-877, 887) #15167: (198-202, 333-339, 1130) #15168: (259-265, 1107) #15169: (422, 1036) #15170: (419-420, 422, 1036) (437-440, 694-695, 709-710) Having written this out, it doesn't feel like a lot of changes. However, they do inherently change some internal processing that has been around for a while. Personally, I'd like to see more testing of a few of these changes in remarkably different usage situations...something outside of my working frame of reference. With that said, I leave it to you to decide what to include, if anything, and what to exclude, if nothing. |
I'm going to merge the whole thing. It seems like you've got a good understanding of this code and if any regressions do pop up, you should be able to address them. So even though I'm a little nervous about this, I'm going to land it since overall it will be an improvement. |
Changes from this PR broke sortable in the very simple case, see #1998. I'll try to understand what may be happening here but if by any chance you're available, @borgboyone (I know, it's been a while) then I'd appreciate any help you could provide. |
PR jquerygh-1793 removed setting `this.offset.parent` in the Draggable `refreshPositions` method which broke position calculations when moving a Draggable item into a connected Sortable. restore that assignment. Ref jquerygh-1793 Fixes jquerygh-2001
PR jquerygh-1793 removed setting `this.offset.parent` in the Draggable `refreshPositions` method which broke position calculations when moving a Draggable item into a connected Sortable. restore that assignment. Ref jquerygh-1793 Fixes jquerygh-2001
Component: ui/widgets/sortable.js