File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -384,7 +384,8 @@ $.widget( "ui.tabs", {
384
384
this . anchors . each ( function ( i , anchor ) {
385
385
var selector , panel , panelId ,
386
386
anchorId = $ ( anchor ) . uniqueId ( ) . attr ( "id" ) ,
387
- tab = $ ( anchor ) . closest ( "li" ) ;
387
+ tab = $ ( anchor ) . closest ( "li" ) ,
388
+ originalAriaControls = tab . attr ( "aria-controls" ) ;
388
389
389
390
// inline tab
390
391
if ( isLocal ( anchor ) ) {
@@ -405,12 +406,13 @@ $.widget( "ui.tabs", {
405
406
if ( panel . length ) {
406
407
that . panels = that . panels . add ( panel ) ;
407
408
}
408
- tab
409
- . data ( "ui-tabs-aria-controls" , tab . attr ( "aria-controls" ) )
410
- . attr ( {
411
- "aria-controls" : selector . substring ( 1 ) ,
412
- "aria-labelledby" : anchorId
413
- } ) ;
409
+ if ( originalAriaControls ) {
410
+ tab . data ( "ui-tabs-aria-controls" , originalAriaControls ) ;
411
+ }
412
+ tab . attr ( {
413
+ "aria-controls" : selector . substring ( 1 ) ,
414
+ "aria-labelledby" : anchorId
415
+ } ) ;
414
416
panel . attr ( "aria-labelledby" , anchorId ) ;
415
417
} ) ;
416
418
You can’t perform that action at this time.
0 commit comments