@@ -58,14 +58,30 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
5858
5959 _updateHeight :function ( ) {
6060
61- this . element . css ( "height" , "auto " ) ;
61+ this . element . css ( "height" , "0px " ) ;
6262
63- var scrollHeight = this . element [ 0 ] . scrollHeight ,
63+ var paddingTop , paddingBottom , paddingHeight ,
64+ scrollHeight = this . element [ 0 ] . scrollHeight ,
65+ clientHeight = this . element [ 0 ] . clientHeight ,
6466 borderTop = parseFloat ( this . element . css ( "border-top-width" ) ) ,
6567 borderBottom = parseFloat ( this . element . css ( "border-bottom-width" ) ) ,
6668 borderHeight = borderTop + borderBottom ,
6769 height = scrollHeight + borderHeight + 15 ;
6870
71+ // Issue 6179: Padding is not included in scrollHeight and
72+ // clientHeight by Firefox if no scrollbar is visible. Because
73+ // textareas use the border-box box-sizing model, padding should be
74+ // included in the new (assigned) height. Because the height is set
75+ // to 0, clientHeight == 0 in Firefox. Therefore, we can use this to
76+ // check if padding must be added.
77+ if ( clientHeight === 0 ) {
78+ paddingTop = parseFloat ( this . element . css ( "padding-top" ) ) ;
79+ paddingBottom = parseFloat ( this . element . css ( "padding-bottom" ) ) ;
80+ paddingHeight = paddingTop + paddingBottom ;
81+
82+ height += paddingHeight ;
83+ }
84+
6985 this . element . css ( "height" , height + "px" ) ;
7086 } ,
7187
0 commit comments