Skip to content

Commit fe567eb

Browse files
committed
Tabs: Properly remove generated aria-controls attributes on destroy.
1 parent 240b22b commit fe567eb

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

ui/jquery.ui.tabs.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ $.widget( "ui.tabs", {
247247
if ( panel.length) {
248248
that.panels = that.panels.add( panel );
249249
}
250-
tab.attr( "aria-controls", selector.substring( 1 ) );
250+
tab
251+
.data( "ui-tabs-aria-controls", tab.attr( "aria-controls" ) )
252+
.attr( "aria-controls", selector.substring( 1 ) );
251253
});
252254
},
253255

@@ -488,8 +490,17 @@ $.widget( "ui.tabs", {
488490
"ui-tabs-panel",
489491
"ui-widget-content",
490492
"ui-corner-bottom"
491-
].join( " " ) )
492-
.removeAttr( "aria-controls" );
493+
].join( " " ) );
494+
}
495+
});
496+
497+
this.lis.each(function() {
498+
var li = $( this ),
499+
prev = li.data( "ui-tabs-aria-controls" );
500+
if ( prev ) {
501+
li.attr( "aria-controls", prev );
502+
} else {
503+
li.removeAttr( "aria-controls" );
493504
}
494505
});
495506

0 commit comments

Comments
 (0)