diff --git a/autosize.jquery.json b/autosize.jquery.json index 103401e..54c3cf4 100644 --- a/autosize.jquery.json +++ b/autosize.jquery.json @@ -2,7 +2,7 @@ "name": "autosize", "title": "Autosize", "description": "Automatically adjust textarea height based on user input.", - "version": "1.17.4", + "version": "1.17.5", "dependencies": { "jquery": ">=1.7" }, diff --git a/bower.json b/bower.json index f2bf6b9..05dadb5 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "jquery-autosize", "description": "Automatically adjust textarea height based on user input.", - "version": "1.17.4", + "version": "1.17.5", "dependencies": { "jquery": ">=1.7" }, diff --git a/jquery.autosize.js b/jquery.autosize.js index 5d3a77d..8e8d2cd 100644 --- a/jquery.autosize.js +++ b/jquery.autosize.js @@ -1,5 +1,5 @@ /*! - Autosize v1.17.4 - 2013-08-22 + Autosize v1.17.5 - 2013-08-22 Automatically adjust textarea height based on user input. (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize license: http://www.opensource.org/licenses/mit-license.php @@ -137,6 +137,11 @@ // The textarea overflow is probably now hidden, but Chrome doesn't reflow the text to account for the // new space made available by removing the scrollbars. This workaround causes Chrome to reflow the text. if ('oninput' in ta && 'setSelectionRange' in ta) { + // The following line ensures that the mirror's width change has been applied with a repaint. + // FireFox may not have repainted the width change yet, which would cause this block to run slowly + // for large blocks of text. + var firefoxFix = mirror.offsetWidth; + var cursorIndex = ta.selectionStart; ta.value += ' '; ta.value = ta.value.slice(0,-1); @@ -159,7 +164,7 @@ mirror.style.overflowY = ta.style.overflowY; original = parseInt(ta.style.height,10); - // Needed for IE8 and lower to reliably return the correct scrollTop + // Setting scrollTop to zero is needed in IE8 and lower for the next step to be accurately applied mirror.scrollTop = 0; mirror.scrollTop = 9e4; diff --git a/jquery.autosize.min.js b/jquery.autosize.min.js index dc68468..b344e75 100644 --- a/jquery.autosize.min.js +++ b/jquery.autosize.min.js @@ -1,7 +1,7 @@ /*! - Autosize v1.17.4 - 2013-08-22 + Autosize v1.17.5 - 2013-08-22 Automatically adjust textarea height based on user input. (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize license: http://www.opensource.org/licenses/mit-license.php */ -(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(window.jQuery||window.$)})(function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='