Permalink
Browse files

Textarea: Turn off overflow for autogrow textarea widgets

This has two benefits:
1. Scrollbars will not affect the reported initial height
2. The scrollbar will not be displayed during the initial animation, only to
   disappear during the final animation frame

Fixes gh-6996
  • Loading branch information...
1 parent 4be611d commit 9904b3fb0ff7bab8eba1e4d174101ba5b1e1e498 @gabrielschulhof gabrielschulhof committed Jan 24, 2014
Showing with 7 additions and 0 deletions.
  1. +4 −0 css/structure/jquery.mobile.forms.textinput.autogrow.css
  2. +3 −0 js/widgets/forms/autogrow.js
@@ -1,3 +1,7 @@
+textarea.ui-input-text.ui-textinput-autogrow {
+ overflow: hidden;
+}
+
.ui-textinput-autogrow-resize {
-webkit-transition: height 0.25s;
-o-transition: height 0.25s;
@@ -26,6 +26,8 @@ define( [
},
_autogrow: function() {
+ this.element.addClass( "ui-textinput-autogrow" );
+
this._on({
"keyup": "_timeout",
"change": "_timeout",
@@ -70,6 +72,7 @@ define( [
},
_unbindAutogrow: function() {
+ this.element.removeClass( "ui-textinput-autogrow" );
this._off( this.element, "keyup change input paste" );
this._off( this.document,
"pageshow popupbeforeposition updatelayout panelopen" );

0 comments on commit 9904b3f

Please sign in to comment.