Widget: Destroy only when element is the actual target#736
Widget: Destroy only when element is the actual target#736marcandre wants to merge 1 commit intojquery:masterfrom marcandre:destroy_if_target
Conversation
ui/jquery.ui.widget.js
Outdated
There was a problem hiding this comment.
You can use this.destroy() here --- _on ensures the widget instance is the context of the callback
|
This seems to make sense to me, @scottgonzalez might have some reason we can't do this. Also, is there a UI ticket on http://bugs.jqueryui.com/ for this? Could you file one? We generally don't accept pulls without a ticket. |
|
I'd rather just fix the naming of our events. I'll look into whether we can get that done for 1.10. If we can, I'll just update this to now, if we can't I'll land this PR (without the |
|
I fixed my pull request. @scottgonzalez If you can rename the event, that's fine too, but even then this patch wouldn't hurt, would it? |
|
@marcandre I'm going to land this. Can you sign our CLA? |
|
Landed in 8bb05d2. |
If ever a 'remove' event was not triggered on the actual widget but on a child and is just bubbling up, then nothing should be done.
Use case: I use a 'remove' event (with bubbling) in my app and without this patch it interferes if the element I trigger it on is contained in a jQuery-ui widget.
http://stackoverflow.com/questions/12584732/how-come-sortable-area-freezes-if-a-remove-event-is-triggered