Skip to content

Commit

Permalink
Reverted to an earlier fix for a Chrome issue. Too many issues with u…
Browse files Browse the repository at this point in the history
…sing setSelectionRange. Fixes jackmoore#104
  • Loading branch information
jackmoore committed Sep 3, 2013
1 parent f634231 commit ce3016b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion autosize.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "autosize",
"title": "Autosize",
"description": "Automatically adjust textarea height based on user input.",
"version": "1.17.6",
"version": "1.17.7",
"dependencies": {
"jquery": ">=1.7"
},
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jquery-autosize",
"description": "Automatically adjust textarea height based on user input.",
"version": "1.17.6",
"version": "1.17.7",
"dependencies": {
"jquery": ">=1.7"
},
Expand Down
12 changes: 6 additions & 6 deletions jquery.autosize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Autosize v1.17.6 - 2013-08-27
Autosize v1.17.7 - 2013-09-03
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
Expand Down Expand Up @@ -136,11 +136,11 @@
// 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);
ta.setSelectionRange(cursorIndex,cursorIndex);
if (window.chrome) {
var width = ta.style.width;
ta.style.width = '0px';
var ignore = ta.offsetWidth;
ta.style.width = width;
}
}

Expand Down
4 changes: 2 additions & 2 deletions jquery.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": "jquery-autosize",
"description": "Automatically adjust textarea height based on user input.",
"version": "1.17.6",
"version": "1.17.7",
"dependencies": {},
"keywords": [
"form",
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.17.7 - 2013/9/3
* Reverted to an earlier fix for a Chrome issue. Too many issues with using setSelectionRange.

### v1.17.6 - 2013/8/24
* Fixed a potential issue introduced in 1.17.4 that causes an 'NS_ERROR_FAILURE' error in Firefox.

Expand Down

0 comments on commit ce3016b

Please sign in to comment.