Skip to content

Commit

Permalink
Fixed issue with assigning autosize to detached nodes. Merged jackmoo…
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmoore committed Sep 2, 2015
1 parent 18fbcf6 commit d40e474
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog

##### v.3.0.9 - 2015-09-02
* Fixed issue with assigning autosize to detached nodes. Merged #253, Fixes #234.

##### v.3.0.8 - 2015-06-29
* Fixed the `autosize:resized` event not being triggered when the overflow changes. Fixes #244.

Expand Down
6 changes: 5 additions & 1 deletion dist/autosize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Autosize 3.0.8
Autosize 3.0.9
license: MIT
http://www.jacklmoore.com/autosize
*/
Expand Down Expand Up @@ -45,6 +45,10 @@
} else {
heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
}
// Fix when a textarea is not on document body and heightOffset is Not a Number
if (isNaN(heightOffset)) {
heightOffset = 0;
}

update();
}
Expand Down
4 changes: 2 additions & 2 deletions dist/autosize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "autosize",
"description": "Autosize is a small, stand-alone script to automatically adjust textarea height to fit text.",
"version": "3.0.8",
"version": "3.0.9",
"keywords": [
"textarea",
"form",
Expand Down
5 changes: 3 additions & 2 deletions src/autosize.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ function assign(ta, {setOverflowX = true, setOverflowY = true} = {}) {
heightOffset = parseFloat(style.borderTopWidth)+parseFloat(style.borderBottomWidth);
}
// Fix when a textarea is not on document body and heightOffset is Not a Number
if (isNaN(heightOffset))
if (isNaN(heightOffset)) {
heightOffset = 0;

}

update();
}

Expand Down

0 comments on commit d40e474

Please sign in to comment.