Skip to content

Commit

Permalink
Fixed a Chrome cursor position issue introduced with the reflow worka…
Browse files Browse the repository at this point in the history
…round added in 1.16.10. Fixes jackmoore#75 & jackmoore#77.
  • Loading branch information
Jack Moore committed Jun 4, 2013
1 parent 8de71ed commit 257b240
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion autosize.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"textarea",
"ui"
],
"version": "1.16.12",
"version": "1.16.13",
"author": {
"name": "Jack Moore",
"url": "http://www.jacklmoore.com",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-autosize",
"version": "1.16.12",
"version": "1.16.13",
"main": "./jquery.autosize.js",
"dependencies": {
"jquery": ">=1.7"
Expand Down
6 changes: 3 additions & 3 deletions jquery.autosize-min.js

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

11 changes: 6 additions & 5 deletions jquery.autosize.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
jQuery Autosize v1.16.12
jQuery Autosize v1.16.13
(c) 2013 Jack Moore - jacklmoore.com
updated: 2013-05-31
updated: 2013-06-04
license: http://www.opensource.org/licenses/mit-license.php
*/

Expand Down Expand Up @@ -101,9 +101,10 @@
// 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) {
var value = ta.value;
ta.value = '';
ta.value = value;
var width = ta.style.width;
ta.style.width = '0px';
var discard = ta.offsetWidth; // trigger a reflow
ta.style.width = width;
}
}

Expand Down
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Small jQuery plugin to allow dynamic resizing of textarea height, so that it gro

## Changelog

### v1.16.13 - 2013/6/4
* Fixed a Chrome cursor position issue introduced with the reflow workaround added in 1.16.10.

### v1.16.12 - 2013/5/31
* Much better efficiency and smoothness for IE8 and lower.

Expand Down

0 comments on commit 257b240

Please sign in to comment.