Skip to content

Commit

Permalink
Fix #11692: jQuery remove event leak (#11693)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Mar 29, 2024
1 parent bfe5c19 commit 21eccd1
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,11 @@ $.widget( "ui.sortable", $.ui.sortable, {

// GitHub #9941 tooltip removal fix
(function() {
var ev = new $.Event('remove'),
orig = $.fn.remove;
var orig = $.fn.remove;
$.fn.remove = function() {
// Don't change JQuery.remove(selector) behavior, so trigger event only when remove is called without arguments.
if (!arguments || arguments.length === 0) {
$(this).trigger(ev);
$(this).trigger(new $.Event('remove'));
}

return orig.apply(this, arguments);
Expand Down

0 comments on commit 21eccd1

Please sign in to comment.