From 6121683d807b2da56cf6cde3240d5926421b280b Mon Sep 17 00:00:00 2001 From: David Petersen Date: Sun, 25 Nov 2012 19:02:36 -0600 Subject: [PATCH] Tabs: Calculate border and padding on tabs container. Fixed #8836: Height overflows parent with heightStyle: 'fill'. --- tests/unit/tabs/tabs_options.js | 10 +++++++++- ui/jquery.ui.tabs.js | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js index f6e89e84f..c78c42b58 100644 --- a/tests/unit/tabs/tabs_options.js +++ b/tests/unit/tabs/tabs_options.js @@ -235,10 +235,18 @@ test( "{ heightStyle: 'content' }", function() { }); test( "{ heightStyle: 'fill' }", function() { - expect( 2 ); + expect( 4 ); $( "#tabs8Wrapper" ).height( 500 ); var element = $( "#tabs8" ).tabs({ heightStyle: "fill" }); equalHeight( element, 485 ); + element.tabs( "destroy" ); + + element = $( "#tabs8" ).css({ + "border": "1px solid black", + "padding": "1px 0" + }); + element.tabs({ heightStyle: "fill" }); + equalHeight( element, 481 ); }); test( "{ heightStyle: 'fill' } with sibling", function() { diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 0b6480123..dcb0c2768 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -497,6 +497,8 @@ $.widget( "ui.tabs", { if ( heightStyle === "fill" ) { maxHeight = parent.height(); + maxHeight -= this.element.outerHeight() - this.element.height(); + this.element.siblings( ":visible" ).each(function() { var elem = $( this ), position = elem.css( "position" ); -- 2.39.5