Skip to content

Commit 4379649

Browse files
committed
Accordion: correct height calculated when closed
Fixes #11938
1 parent 7e4d6bf commit 4379649

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ui/accordion.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,14 @@ return $.widget( "ui.accordion", {
361361
maxHeight = 0;
362362
this.headers.next()
363363
.each( function() {
364-
var display = $( this ).css( "display" );
365-
$( this ).css( "display", "block" );
364+
var isVisible = $( this ).is ( ":visible" );
365+
if ( !isVisible ) {
366+
$( this ).show();
367+
}
366368
maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
367-
$( this ).css( "display", display );
369+
if ( !isVisible ) {
370+
$( this ).hide();
371+
}
368372
} )
369373
.height( maxHeight );
370374
}

0 commit comments

Comments
 (0)