Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Autogrow: fix height calculation to account for borders Fixes #6180 -…
Browse files Browse the repository at this point in the history
… Autogrow: calculated height contains border height and Fixes #6178 - Textinput: height not correctly calculated due to box-sizing thanks @jhogervorst
  • Loading branch information
arschmitz committed Aug 6, 2013
1 parent 4ab19a7 commit 48139f8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions js/widgets/forms/autogrow.js
Expand Up @@ -58,12 +58,15 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".

_updateHeight:function() {

this.element.css({
height: "auto"
}).css({
height: this.element[0].scrollHeight + 15 + "px"
});

this.element.css( "height", "auto" );

var scrollHeight = this.element[0].scrollHeight,
borderTop = parseFloat( this.element.css( "border-top-width" ) ),
borderBottom = parseFloat( this.element.css( "border-bottom-width" ) ),
borderHeight = borderTop + borderBottom,
height = scrollHeight + borderHeight + 15;

this.element.css( "height", height + "px" );
},

_setOptions: function( options ){
Expand Down

0 comments on commit 48139f8

Please sign in to comment.