Skip to content

Sortable: Pass this to _uiHash() when firing 'remove' events. Fixes #9738: Remove event object doesn't contain sender when moving an item between connected sortables. #1171

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

Closed
wants to merge 1 commit into from

Conversation

NiGhTTraX
Copy link
Contributor

No description provided.

ok( hash.position && ( "top" in hash.position && "left" in hash.position ), "UI hash includes: position" );
ok( hash.offset && ( hash.offset.top && hash.offset.left ), "UI hash includes: offset" );
ok( hash.item, "UI hash includes: item" );
ok( hash.sender, "UI hash includes: sender" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of just testing for existence, compare item and sender to the actual elements they should be set to.

@tjvantoll
Copy link
Member

I confirmed this works: http://jsfiddle.net/tj_vantoll/2snbn/. I will say that it's a little strange to need a sender in a remove event, which is probably why this hasn't come up before, but I think it's worth having for consistency.

fyi @NiGhTTraX our commit message guidelines have recently changed. You can either rebase this to clean it up or we can fix it when we land this.

I have one minor comment otherwise this looks good to me.

Fixes #9738: Remove event object doesn't contain sender when moving an item between connected sortables.
@NiGhTTraX
Copy link
Contributor Author

Updated and squashed.

@tjvantoll I guess it's strange, but the documentation mentioned it. It would be more useful to have an attribute pointing to the list that received the element.

@scottgonzalez
Copy link
Member

Would it make more sense to just update the docs to reflect the current API? This seems more like a docs bug than an implementation bug.

@scottgonzalez
Copy link
Member

Essentially, I'm wondering if this consistency is providing actual benefit for some use cases. The ticket didn't provide a real use case, it just shows a bug based on the documentation (which in itself is a legitimate bug). Presumably this was never implemented and it's always been a documentation bug, but we've never received a ticket until now.

@NiGhTTraX
Copy link
Contributor Author

I guess the best way would be to update the documentation. Should I create an issue at https://github.com/jquery/api.jqueryui.com ?

@scottgonzalez
Copy link
Member

That'd be great. Let me know if you plan to send a PR to fix the documentation as well. If not, I'll fix it after you file the issue.

Thanks.

@NiGhTTraX
Copy link
Contributor Author

Created issue jquery/api.jqueryui.com#188 and sent PR jquery/api.jqueryui.com#189

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