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

Textarea disappearing in Chrome and JQM 1.4.0 #6801

Closed
nathany opened this issue Dec 12, 2013 · 28 comments
Closed

Textarea disappearing in Chrome and JQM 1.4.0 #6801

nathany opened this issue Dec 12, 2013 · 28 comments

Comments

@nathany
Copy link

nathany commented Dec 12, 2013

Issue description

When typing into a textarea it disappears from the screen. We received the bug report from a Samsung Galaxy Tab user, which we were able to reproduce.

Steps to reproduce

Begin typing into a text area, or use a stylus with handwriting recognition with a Galaxy Tab.

Expected outcome

The text area to be visible to see what is being written.

Actual outcome

textarea

Platforms/browsers (including version) and devices tested

Chrome 31.0.1650.59 under Android 4.1.2 on a Samsung Galaxy Tab.

Text areas are also disappearing on the desktop version of Chrome 31.0.1650.63 on Mac OS X 10.9.

jQuery Mobile and jQuery core version used

We are running 1.4.0 rc1, however the following test page exhibits the issue against master. Verified that the description field doesn't disappear when JQM is not loaded.

<!DOCTYPE html>
<html>
<head>
  <title>JQM latest - issue template</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://code.jquery.com/mobile/git/jquery.mobile-git.css">
  <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
  <script src="http://code.jquery.com/mobile/git/jquery.mobile-git.js"></script>
</head>
<body>

  <div data-role="page">

    <div data-role="header">
      <h1>Issue template</h1>
    </div><!-- /header -->

    <div class="ui-content">

      <form accept-charset="UTF-8" action="/some/url" class="some_form" data-transition="pop" id="some_form" method="post">

        <div data-role="fieldcontain">
          <label for="to_do_description">Description</label>
          <textarea cols="40" data-mini="true" id="to_do_description" name="to_do[description]" rows="2"></textarea>
        </div>

      </form>

    </div><!-- /content -->

  </div><!-- /page -->

</body>
</html>

http://jsbin.com/IFolanOW/5/edit

@jamesjnadeau
Copy link

I can reproduce this using the jsbin on my Asus Transformer pad 300, 4.2.1 chrome
Switching tabs brings it back, landscape or portrait makes no difference.
Does a weird zôom when the textarea is selected

However

Works fine on my motox 4.2.2, chrome

@quickly79
Copy link

I cannot reproduce this on desktop using Chrome Version 31.0.1650.63 Mac OSX 10.8.5

@nathany
Copy link
Author

nathany commented Dec 13, 2013

@quickly79 I wonder if this is a video driver difference (if JQM is using the GPU). OS X 10.9 and Intel 4000 here.

@forrest
Copy link

forrest commented Dec 13, 2013

Perhaps a 3d transform is causing unexpected issues?

@josemvidal
Copy link

I just ran into this problem on a Mac (OSX 10.9.1) running Chrome Beta, and Canary, and Chrome 31.0.1650.63. Loaded the html page above to confirm.

The textarea disappears after typing just one character in it. There is some flickering as this happens. Devtools still shows it in the DOM, and highlights its position on the page, but its not there anymore and I cannot type into it.

Both Safari and Firefox on the same machine work fine, only Chrome fails.

screen shot 2013-12-19 at 9 28 20 pm

@fortress-of-solitude
Copy link

I see a somewhat similar issue on iOS6/7 devices (iPhone & iPad). The textarea is embedded in a popup. So as a character is typed, the text area momentarily disappears causing the popup to be redrawn. Since the textarea does return (i.e. it does not totally disappear) the resultant effect is that the popup appears to flicker with the typing of each character.

@josemvidal
Copy link

As a workaround, I found that getting rid of the float:left in

@media (min-width: 28em) {
......
    .ui-field-contain > label + [class*="ui-"],
    .ui-field-contain .ui-controlgroup-controls {
        float: left; /*delete this one */
        width: 78%;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
        box-sizing: border-box;
    }

seems to fix that problem. But, it breaks the slider widget.

@arschmitz
Copy link
Contributor

This is a rendering bug in chrome we will need to look into it to see if there is a possible workaround.

@fortress-of-solitude
Copy link

Should I file a separate issue for "similar issue on iOS6/7 devices (iPhone & iPad). The textarea is embedded in a popup. So as a character is typed, the text area momentarily disappears causing the popup to be redrawn. Since the textarea does return (i.e. it does not totally disappear) the resultant effect is that the popup appears to flicker with the typing of each character"

@amirpeivandi
Copy link

Any update on this issue?

@nathany
Copy link
Author

nathany commented Jan 8, 2014

@arschmitz Do you have a reference to the issue in Chromium? https://code.google.com/p/chromium/issues/list

@m4ff
Copy link

m4ff commented Feb 1, 2014

I solved the problem by adding style="position: relative" to the textarea.

@nathany
Copy link
Author

nathany commented Feb 3, 2014

Thanks @m4ff. That workaround works for me under the desktop verison of Chrome 32.0.1700.107.

Unfortunately the flicker still occurs when trying to do this via css:

textarea {
  position: relative !important;
}

😦

mmariani pushed a commit to mmariani/jdocman that referenced this issue Feb 6, 2014
mmariani pushed a commit to mmariani/jdocman that referenced this issue Feb 6, 2014
@gabrielschulhof
Copy link

I wonder if this has anything to do with the fact that we momentarily set the textarea height to 0 whenever the user types a single character. We do that so as to compute the height the textarea such that no scrollbar appears. It's part of the autogrow extension.

Try setting data-autogrow="false" on the textarea and see if you're still seeing this problem.

@nathany
Copy link
Author

nathany commented Feb 10, 2014

@gabrielschulhof Yes, it is related.

Just testing on desktop Chrome 32.0.1700.107 (without even using emulate) data-autogrow="false" solves the problem.

Note: we are still on JQM 1.4.0-rc.1. We should really get that upgraded.

@fortress-of-solitude
Copy link

@gabrielschulhof Yes, I am absolutely convinced it is related. On iOS devices the flicker effect is very pronounced with JQM 1.40

I'm making do with this minimal but kludgy fix... just added the 'else' as indicated below.

    _prepareHeightUpdate: function( delay ) {
        if ( this.keyupTimeout ) {
            clearTimeout( this.keyupTimeout );
        } >> else <<
        if ( delay === undefined ) {
            this._updateHeight();
        } else {
            this.keyupTimeout = this._delay( "_updateHeight", delay );
        }
    },

@gabrielschulhof gabrielschulhof modified the milestones: 1.4.3, 1.4.1 Mar 1, 2014
@gabrielschulhof
Copy link

@arschmitz we should consider removing the code that sets the height to 0. FF may have obviated the reason for adding it, and now that we have overflow hidden on autogrow text areas there should be no scrollbar, even if we are slightly off with our calculation. As long as the text is never clipped, we should be able to do without setting the height to 0.

@jaspermdegroot
Copy link
Contributor

As discussed during our weekly meeting on May 1 we are going to remove the code that sets the height to 0, but test thoroughly on several browsers/devices before merging in master.

@gabrielschulhof
Copy link

OK, I didn't think it through. Setting the height to 0 is necessary not only for the FF bug, which may be gone, but also for measuring the height of the text inside the textarea, which is essential to the autoshrink feature. So, if we remove the code that sets the height to 0, we also remove the ability to autoshrink.

@jaspermdegroot
Copy link
Contributor

Whatever we do to fix this without breaking autoshrink, we have to test on IE8 to make sure we don't reintroduce #6998.

@jaspermdegroot jaspermdegroot modified the milestones: 1.4.4, 1.4.3 Jun 5, 2014
@gabrielschulhof
Copy link

Since I don't believe we can fix this without setting the height to 0, and since this is a Chrome bug, and Chrome does get updates, I'm wondering: Is this bug still reproducible? @fortress-of-solitude? @nathany? @josemvidal? @jamesjnadeau?

@jamesjnadeau
Copy link

I'm unable to reproduce this on my devices anymore, yay evergreen browsers! I vote for closing....

@jaspermdegroot
Copy link
Contributor

Thanks @jamesjnadeau ! @nathany can you confirm? I am closing this ticket as resolved, but we will re-open if you still notice the problem.

@jaspermdegroot jaspermdegroot removed this from the 1.4.4 milestone Sep 8, 2014
@nathany
Copy link
Author

nathany commented Sep 10, 2014

@jaspermdegroot Sorry for the delay. I tracked down a Galaxy Tab, but of course it is now running Chrome 37 rather than Chrome 31. No issues to report.

Between Crosswalk and asking people to upgrade Chrome, we have no need to support old versions of Chrome on Android.

@arschmitz
Copy link
Contributor

@nathany we only support current -1 for chrome so 31 is no longer supported.

@aquachroma
Copy link

@jaspermdegroot @gabrielschulhof
Textarea disappearing on current latest safari release Version 8.0 (10600.1.25) and on Chrome 38.0.2125.104 both on OS X 10.10.

Problem hasn't gone away on everything.

@beveradb
Copy link

This is still reproducible with jQM 1.4.5 in any Android WebView (which includes anyone using phonegap). Even on a device (Nexus 7 2013) with the latest version of Android (5.0 Lollipop), this is still reproducible inside a WebView.
I don't know if it's a WebKit issue or Chrome specifically, because supposedly the Android WebView is now using a current (537.36) version of WebKit?

Either way, I think this should be re-opened as it still causes issues for anyone using an Android WebView / Phonegap.
My current workaround is data-autogrow="false", which at least makes the textarea usable again.

@usmonster
Copy link

Maybe related to https://crbug.com/417133 and/or https://crbug.com/447421 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests