Skip to content

Commit 60789e2

Browse files
Merge pull request jquery-archive#5848 from jhogervorst/issue-5690
Textinput: height correctly calculated (without extra padding) for box-sizing
1 parent 8ff0c55 commit 60789e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/widgets/forms/textinput.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ $.widget( "mobile.textinput", $.mobile.widget, {
125125
clientHeight = input[ 0 ].clientHeight;
126126

127127
if ( clientHeight < scrollHeight ) {
128-
input.height( scrollHeight + extraLineHeight );
128+
var paddingTop = parseFloat( input.css( "padding-top" ) ),
129+
paddingBottom = parseFloat( input.css( "padding-bottom" ) ),
130+
paddingHeight = paddingTop + paddingBottom;
131+
132+
input.height( scrollHeight - paddingHeight + extraLineHeight );
129133
}
130134
};
131135

0 commit comments

Comments
 (0)