From b1612cfc4a40ba73095cffe89eeaae29c7514805 Mon Sep 17 00:00:00 2001 From: Leonidaz Date: Thu, 17 Jan 2013 11:03:05 -0500 Subject: [PATCH] Update jquery.autosize.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit on IE8 when textarea has display:none causes error:  Invalid argument.  jquery.autosize.js, line 116 character 6 the width() returned by jQuery is a negative number, assigning it in IE8 causes the error. --- jquery.autosize.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.autosize.js b/jquery.autosize.js index 9e3b4c1..3bda005 100644 --- a/jquery.autosize.js +++ b/jquery.autosize.js @@ -113,7 +113,7 @@ original = parseInt(ta.style.height,10); // Update the width in case the original textarea width has changed - mirror.style.width = $ta.width() + 'px'; + mirror.style.width = ($ta.width() < 0 ? 0 : $ta.width()) + 'px'; // The following three lines can be replaced with `height = mirror.scrollHeight` when dropping IE7 support. mirror.scrollTop = 0;