iscroll icon indicating copy to clipboard operation
iscroll copied to clipboard

Android password input overlay incorrectly positioned

Open GCheung55 opened this issue 15 years ago • 17 comments

Hey Matteo! Great work on iScroll!

I'm trying to debug an issue that appears to only affect password input elements on Android 2.3.3.

Android tries to overlays its own password input over the focused password input element. But it seems to position incorrectly when it is inside of an element that is hooked up with iScroll.

The only option I've changed is onBeforeScrollStart, which looks like:

function(){
    var target = e.target,
        tagName = (target && target.nodeType == 1) ? target.tagName.toLowerCase() : null;

    if (!tagName || (tagName != 'select' && tagName != 'input' && tagName != 'textarea')) {
        e.preventDefault();
    }
}

GCheung55 avatar Sep 21 '11 05:09 GCheung55

Bump. I'm having the same issue with 2.3.4

The android browser is floating a duplicate input box for input type="password" and similarly with input type="text"

Things get tricky and annoying for the user when they try to scroll the form down to the next input. The floating duplicate input stays above the iscroll div which shows the original input element scrolling towards the top and beyond.

arsena avatar Nov 09 '11 20:11 arsena

I just replicated this in 2.2

arsena avatar Nov 09 '11 21:11 arsena

I am also having this issue and cannot find much information regarding it, has anyone identified a fix/workaround for this problem?

ollycox avatar Dec 02 '11 09:12 ollycox

Same here on Android 2.3.5 (HTC stock rom). Seems like the browser looses track of the actual position of the input element if the parent container is transformed. BTW: bug is not present in latest cyanogenmod (Android 2.3.7)

Occams avatar Dec 14 '11 15:12 Occams

Same problem here on any text input element on Android phones. Anyone have a fix/hack for this yet? Really bumming me out in project I am working on.

kevindeleon avatar Dec 19 '11 17:12 kevindeleon

I am having same problem..Anyone have a fix/hack for this yet? Without iscroll.js is working fine for me... Please response.. I am really stuck on this..

Thanks in advance...

jayantvaish avatar Jan 11 '12 11:01 jayantvaish

Anyone know how to resolve this? I'm having the same issue and is very annoying!

Thank you :D

ghost avatar Jan 20 '12 04:01 ghost

Not necessarily a great resolution to the issue - but I found a bit more information and a potential workaround. It seems to be an issue in Android's browser that has issues with the -webkit-transform: translate3d attribute. Try adding this to specific 'input' elements: -webkit-transform: translate3d(0,0,0);

Found via this question: http://stackoverflow.com/questions/5347078/android-webview-input-boxes-doubled More info here: http://java-cerise.blogspot.com/2011/10/dodgy-double-input-fields-on-android.html

Note: In the blog, he suggests adding it to the parent div, but that didn't work for me. I literally had to add it to each and every input element.

Would love a real solution though - the workaround can easily become impractical...

jgohil avatar Jan 31 '12 17:01 jgohil

this problem is wired, set translate3d(0, 0, 0) is not work for me , and I just set useTransform: false for android, like : new iScroll('menu', { useTransform: !$.os.android, vScrollbar:false, hScrollbar:false, onScrollEnd: function() { this.refresh(); } });

done!

sunsetsunrise avatar Mar 05 '12 09:03 sunsetsunrise

Hey, so did anybody find the workaround for this problem ? Setting translate3d(0,0,0) did not work for me, also when i put useTransform: !$.os.android I get an error as "Uncaught TypeError: Cannot read property 'android' of undefined". Has anybody found the fix to this bug ?

saurjk avatar Mar 30 '12 10:03 saurjk

I found this bug today on Android 2.3.4 ( has any one got any answer yet ).

Yene-Me avatar Nov 14 '12 21:11 Yene-Me

The following magical CSS property did the trick for me:

input {
    -webkit-user-modify: read-write-plaintext-only;
}

rraval avatar Nov 16 '12 04:11 rraval

Using this CSS property made it impossible for me to paste something into the input field anymore. Seems like a trade-off between bad UI and bad UX.

prud avatar Nov 18 '12 23:11 prud

Having the same issue for most Samsung and HTC devices running Android 4.0.3. For some devices this worked for me, but not for all (with jQuery or Zepto JS):

if ($.os.android) {
      if ($('input:focus, select:focus, textarea:focus').length > 0) {
            $(':focus').blur();
      }
}

Still waiting for a global solution.

laszlo-horvath avatar Nov 30 '12 15:11 laszlo-horvath

input {
    -webkit-user-modify: read-write-plaintext-only;
}

Did it for me. Android 4.0.4, JQM 1.3, JQ 1.9.1 - Oddly, I was only experiencing this on Motorola devices....

red2678 avatar Mar 08 '13 22:03 red2678

input { -webkit-user-modify: read-write-plaintext-only; }

but scroll not working

chrisjul avatar Apr 13 '13 13:04 chrisjul

v4 or earlier is unsupported. Please check out v5 if you have this issue. v5 comes with limited form support and will continue to improve in that regard.

davidpfahler avatar Dec 22 '13 12:12 davidpfahler