From 6f00d35db8a69c6bdeef61de981d367c0d6294ee Mon Sep 17 00:00:00 2001 From: John Bender Date: Mon, 21 Nov 2011 10:15:47 -0800 Subject: [PATCH] move pagechange binding for textarea autogrow outside the check for text content --- js/jquery.mobile.forms.textinput.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/jquery.mobile.forms.textinput.js b/js/jquery.mobile.forms.textinput.js index f44c8a80..e44229fb 100644 --- a/js/jquery.mobile.forms.textinput.js +++ b/js/jquery.mobile.forms.textinput.js @@ -96,15 +96,15 @@ $.widget( "mobile.textinput", $.mobile.widget, { keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer ); }); + // binding to pagechange here ensures that for pages loaded via + // ajax the height is recalculated without user input + $( document ).one( "pagechange", keyup ); + // Issue 509: the browser is not providing scrollHeight properly until the styles load if ( $.trim( input.val() ) ) { // bind to the window load to make sure the height is calculated based on BOTH // the DOM and CSS $( window ).load( keyup ); - - // binding to pagechange here ensures that for pages loaded via - // ajax the height is recalculated without user input - $( document ).one( "pagechange", keyup ); } } },