diff --git a/autosize.jquery.json b/autosize.jquery.json
index 54c3cf4..42fac50 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.5",
+ "version": "1.17.6",
"dependencies": {
"jquery": ">=1.7"
},
diff --git a/bower.json b/bower.json
index 05dadb5..69821a6 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.5",
+ "version": "1.17.6",
"dependencies": {
"jquery": ">=1.7"
},
diff --git a/jquery.autosize.js b/jquery.autosize.js
index 8e8d2cd..42d8806 100644
--- a/jquery.autosize.js
+++ b/jquery.autosize.js
@@ -1,5 +1,5 @@
/*!
- Autosize v1.17.5 - 2013-08-22
+ Autosize v1.17.6 - 2013-08-24
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
@@ -133,15 +133,10 @@
setWidth();
- // This code block fixes a Chrome-specific issue:
- // 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;
-
+ // Chrome-specific fix:
+ // When the textarea y-overflow is hidden, Chrome doesn't reflow the text to account for the space
+ // made available by removing the scrollbar. This workaround triggers the reflow for Chrome.
+ if (window.chrome && 'setSelectionRange' in ta) {
var cursorIndex = ta.selectionStart;
ta.value += ' ';
ta.value = ta.value.slice(0,-1);
diff --git a/jquery.autosize.min.js b/jquery.autosize.min.js
index b344e75..29e7afe 100644
--- a/jquery.autosize.min.js
+++ b/jquery.autosize.min.js
@@ -1,7 +1,7 @@
/*!
- Autosize v1.17.5 - 2013-08-22
+ Autosize v1.17.6 - 2013-08-24
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='',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var t,o;"getComputedStyle"in window?(t=window.getComputedStyle(h),o=h.getBoundingClientRect().width,e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){o-=parseInt(t[i],10)}),s.style.width=o+"px"):s.style.width=Math.max(f.width(),0)+"px"}function a(){var a={};if(t=h,s.className=i.className,c=parseInt(f.css("maxHeight"),10),e.each(n,function(e,t){a[t]=f.css(t)}),e(s).css(a),o(),"oninput"in h&&"setSelectionRange"in h){s.offsetWidth;var r=h.selectionStart;h.value+=" ",h.value=h.value.slice(0,-1),h.setSelectionRange(r,r)}}function r(){var e,n;t!==h?a():o(),s.value=h.value+i.append,s.style.overflowY=h.style.overflowY,n=parseInt(h.style.height,10),s.scrollTop=0,s.scrollTop=9e4,e=s.scrollTop,c&&e>c?(h.style.overflowY="scroll",e=c):(h.style.overflowY="hidden",d>e&&(e=d)),e+=p,n!==e&&(h.style.height=e+"px",w&&i.callback.call(h,h))}function l(){clearTimeout(u),u=setTimeout(function(){var e=f.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var c,d,u,h=this,f=e(h),p=0,w=e.isFunction(i.callback),z={height:h.style.height,overflow:h.style.overflow,overflowY:h.style.overflowY,wordWrap:h.style.wordWrap,resize:h.style.resize},g=f.width();f.data("autosize")||(f.data("autosize",!0),("border-box"===f.css("box-sizing")||"border-box"===f.css("-moz-box-sizing")||"border-box"===f.css("-webkit-box-sizing"))&&(p=f.outerHeight()-f.height()),d=Math.max(parseInt(f.css("minHeight"),10)-p||0,f.height()),f.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===f.css("resize")||"vertical"===f.css("resize")?"none":"horizontal"}),"onpropertychange"in h?"oninput"in h?f.on("input.autosize keyup.autosize",r):f.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):f.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),f.on("autosize.resize",r),f.on("autosize.resizeIncludeStyle",function(){t=null,r()}),f.on("autosize.destroy",function(){t=null,clearTimeout(u),e(window).off("resize",l),f.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})}});
\ No newline at end of file
+(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='',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var t,o;"getComputedStyle"in window?(t=window.getComputedStyle(h),o=h.getBoundingClientRect().width,e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){o-=parseInt(t[i],10)}),s.style.width=o+"px"):s.style.width=Math.max(p.width(),0)+"px"}function a(){var a={};if(t=h,s.className=i.className,c=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){a[t]=p.css(t)}),e(s).css(a),o(),window.chrome&&"setSelectionRange"in h){var r=h.selectionStart;h.value+=" ",h.value=h.value.slice(0,-1),h.setSelectionRange(r,r)}}function r(){var e,n;t!==h?a():o(),s.value=h.value+i.append,s.style.overflowY=h.style.overflowY,n=parseInt(h.style.height,10),s.scrollTop=0,s.scrollTop=9e4,e=s.scrollTop,c&&e>c?(h.style.overflowY="scroll",e=c):(h.style.overflowY="hidden",d>e&&(e=d)),e+=f,n!==e&&(h.style.height=e+"px",w&&i.callback.call(h,h))}function l(){clearTimeout(u),u=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var c,d,u,h=this,p=e(h),f=0,w=e.isFunction(i.callback),z={height:h.style.height,overflow:h.style.overflow,overflowY:h.style.overflowY,wordWrap:h.style.wordWrap,resize:h.style.resize},g=p.width();p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(f=p.outerHeight()-p.height()),d=Math.max(parseInt(p.css("minHeight"),10)-f||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===p.css("resize")||"vertical"===p.css("resize")?"none":"horizontal"}),"onpropertychange"in h?"oninput"in h?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(u),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})}});
\ No newline at end of file
diff --git a/package.json b/package.json
index 195b185..3a5c927 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "jquery-autosize",
"description": "Automatically adjust textarea height based on user input.",
- "version": "1.17.5",
+ "version": "1.17.6",
"dependencies": {},
"keywords": [
"form",
diff --git a/readme.md b/readme.md
index 22f1d41..91facf4 100644
--- a/readme.md
+++ b/readme.md
@@ -4,8 +4,11 @@ Small jQuery plugin to allow dynamic resizing of textarea height, so that it gro
## Changelog
+### v1.17.6 - 2013/8/24
+* Fixed a potential issue introduced in 1.17.4 that causes an 'NS_ERROR_FAILURE' error in Firefox.
+
### v1.17.5 - 2013/8/23
-* Fixed oversight in previous commit that caused FireFox fix not to be applied.
+* Fixed oversight in 1.17.4 that caused FireFox fix not to be applied.
### v1.17.4 - 2013/8/22
* Improved speed of editing large blocks of text in FireFox.