Skip to content

Commit

Permalink
fixed oversight in previous commit that caused FireFox fix not to be …
Browse files Browse the repository at this point in the history
…applied (#fixes 99)
  • Loading branch information
jackmoore committed Aug 23, 2013
1 parent 6cc075b commit 1a14525
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 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.4",
"version": "1.17.5",
"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.4",
"version": "1.17.5",
"dependencies": {
"jquery": ">=1.7"
},
Expand Down
9 changes: 7 additions & 2 deletions jquery.autosize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Autosize v1.17.4 - 2013-08-22
Autosize v1.17.5 - 2013-08-22
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 @@ -137,6 +137,11 @@
// 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;

var cursorIndex = ta.selectionStart;
ta.value += ' ';
ta.value = ta.value.slice(0,-1);
Expand All @@ -159,7 +164,7 @@
mirror.style.overflowY = ta.style.overflowY;
original = parseInt(ta.style.height,10);

// Needed for IE8 and lower to reliably return the correct scrollTop
// Setting scrollTop to zero is needed in IE8 and lower for the next step to be accurately applied
mirror.scrollTop = 0;

mirror.scrollTop = 9e4;
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.4",
"version": "1.17.5",
"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.5 - 2013/8/23
* Fixed oversight in previous commit that caused FireFox fix not to be applied.

### v1.17.4 - 2013/8/22
* Improved speed of editing large blocks of text in FireFox.

Expand Down

0 comments on commit 1a14525

Please sign in to comment.