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 ); } } },