Skip to content

Commit 6121683

Browse files
petersendiditscottgonzalez
authored andcommitted
Tabs: Calculate border and padding on tabs container. Fixed #8836: Height overflows parent with heightStyle: 'fill'.
1 parent ee8d20e commit 6121683

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

tests/unit/tabs/tabs_options.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,18 @@ test( "{ heightStyle: 'content' }", function() {
235235
});
236236

237237
test( "{ heightStyle: 'fill' }", function() {
238-
expect( 2 );
238+
expect( 4 );
239239
$( "#tabs8Wrapper" ).height( 500 );
240240
var element = $( "#tabs8" ).tabs({ heightStyle: "fill" });
241241
equalHeight( element, 485 );
242+
element.tabs( "destroy" );
243+
244+
element = $( "#tabs8" ).css({
245+
"border": "1px solid black",
246+
"padding": "1px 0"
247+
});
248+
element.tabs({ heightStyle: "fill" });
249+
equalHeight( element, 481 );
242250
});
243251

244252
test( "{ heightStyle: 'fill' } with sibling", function() {

ui/jquery.ui.tabs.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,8 @@ $.widget( "ui.tabs", {
497497

498498
if ( heightStyle === "fill" ) {
499499
maxHeight = parent.height();
500+
maxHeight -= this.element.outerHeight() - this.element.height();
501+
500502
this.element.siblings( ":visible" ).each(function() {
501503
var elem = $( this ),
502504
position = elem.css( "position" );

0 commit comments

Comments
 (0)