We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e8e52d commit 849c6fdCopy full SHA for 849c6fd
ui/accordion.js
@@ -259,13 +259,22 @@ return $.widget( "ui.accordion", {
259
},
260
261
_processPanels: function() {
262
+ var prevHeaders = this.headers,
263
+ prevPanels = this.panels;
264
+
265
this.headers = this.element.find( this.options.header )
266
.addClass( "ui-accordion-header ui-state-default ui-corner-all" );
267
- this.headers.next()
268
+ this.panels = this.headers.next()
269
.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
270
.filter( ":not(.ui-accordion-content-active)" )
271
.hide();
272
273
+ // Avoid memory leaks (#10056)
274
+ if ( prevPanels ) {
275
+ this._off( prevHeaders.not( this.headers ) );
276
+ this._off( prevPanels.not( this.panels ) );
277
+ }
278
279
280
_refresh: function() {
0 commit comments