Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Textarea: Use feature detection to avoid setting height to 0 on IE8
Browse files Browse the repository at this point in the history
Also replaces the immediate height update with a timed one, because the
immediate height update issued from _autogrow() is having no effect in IE.

Fixes gh-6998
  • Loading branch information
Gabriel Schulhof committed Jan 27, 2014
1 parent 09832f3 commit e2aa0f0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions js/widgets/forms/autogrow.js
Expand Up @@ -65,7 +65,7 @@ define( [
this.element.removeClass( "ui-textinput-autogrow-resize" );
}, this ) );
}
this._prepareHeightUpdate();
this._timeout();
}
},

Expand Down Expand Up @@ -96,11 +96,14 @@ define( [

this.keyupTimeout = 0;

this.element.css({
"height": 0,
"min-height": 0,
"max-height": 0
});
// IE8 textareas have the onpage property - others do not
if ( !( "onpage" in this.element[ 0 ] ) ) {
this.element.css({
"height": 0,
"min-height": 0,
"max-height": 0
});
}

var paddingTop, paddingBottom, paddingHeight,
scrollHeight = this.element[ 0 ].scrollHeight,
Expand Down

0 comments on commit e2aa0f0

Please sign in to comment.