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

Commit cdf5fd0

Browse files
committed
Autogrow: No longer mind to page show set height during create
Also remove the animation during the initial create height setting
1 parent 4af34df commit cdf5fd0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

js/widgets/forms/autogrow.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ return $.widget( "mobile.textinput", $.mobile.textinput, {
5555
// Attach to the various you-have-become-visible notifications that the
5656
// various framework elements emit.
5757
// TODO: Remove all but the updatelayout handler once #6426 is fixed.
58+
this._handleShow( "create" );
5859
this._on( true, this.document, {
59-
60-
// TODO: Move to non-deprecated event
61-
"pageshow": "_handleShow",
6260
"popupbeforeposition": "_handleShow",
6361
"updatelayout": "_handleShow",
6462
"panelopen": "_handleShow"
@@ -73,10 +71,10 @@ return $.widget( "mobile.textinput", $.mobile.textinput, {
7371
// content has become visible, but the collapsible is still collapsed, so
7472
// the autogrow textarea is still not visible.
7573
_handleShow: function( event ) {
76-
if ( $.contains( event.target, this.element[ 0 ] ) &&
77-
this.element.is( ":visible" ) ) {
74+
if ( event === "create" || ( $.contains( event.target, this.element[ 0 ] ) &&
75+
this.element.is( ":visible" ) ) ) {
7876

79-
if ( event.type !== "popupbeforeposition" ) {
77+
if ( event !== "create" && event.type !== "popupbeforeposition" ) {
8078
this._addClass( "ui-textinput-autogrow-resize" );
8179
this.element
8280
.animationComplete(

0 commit comments

Comments
 (0)