15

I have a problem that I'm not sure if it is a bug, some weirdness about the android keyboard, etc.

Suppose you have this input box somewhere:

    <input type='number' step='any' >

On the default ICS android browser, the Safari mobile browser, iOS Chrome (and probably others), this does exactly what you would expect: it brings up a keyboard with both numbers and a decimal point (because of the step).

However on Chrome on android (and as I said only this version), it brings up a number pad with no decimal.

Does anyone know a workaround?

Additional Details

It appears to be limited to a combination of the Samsung keyboard and Google Chrome. The following works:

  • Google Chrome with 3rd Party Keyboard
  • Main Browser and Firefox with Samsung Keyboard

So, it seems only the combination of both the Samsung keyboard and Chrome that causes a problem.

tazz_ben
  • 259
  • 3
  • 10
  • 1
    What device are you testing this on? Using Chrome on my Nexus 7 I get a numerical keyboard with decimal and other numerical symbols #-,+.*/()+ – Michael Celey Sep 20 '12 at 14:11
  • This is on a samsung G. S III – tazz_ben Sep 20 '12 at 16:35
  • Also, I did some testing and the field allows you to have a decimal (I put a decimal in another field and copied->pasted it into the number field), it is only an issue of the keyboard. – tazz_ben Sep 20 '12 at 16:37
  • Samsung replaces the stock keyboard with their own Android styled keyboard so it might just be a samsung specific problem. My Nexus S presents a keyboard with a decimal, as do the other test devices I have on my desk. (Galaxy Nexus, Nexus 7, Asus Transformer Prime) The Nexus devices run stock Android and not the modified Samsung Android skin which is why they would work despite being Samsung devices. – Michael Celey Sep 20 '12 at 16:40
  • Why would it work in Android's browser (on the SIII) then. If it was an issue with Samsung's keyboard skin, it seems like it would be causing issues in all browsers on the device. – tazz_ben Sep 20 '12 at 17:12
  • It all depends on how the system handles the request for the keyboard to be shown. The built-in browser typically responds to system events better since Samsung has access to that code and can put their skinning on the browser while Chrome is a completely separate standalone app. – Michael Celey Sep 20 '12 at 17:14
  • I just tested it on Firefox (same device -- Firefox is an installed from play store standalone app), works fine. It is specific to Chrome. – tazz_ben Sep 20 '12 at 19:07

2 Answers2

6

This issue appears to be fixed https://code.google.com/p/chromium/issues/detail?id=151738#c17 . I think this was fixed in Chrome Mobile 36 released June 2014 - it certainly is fixed in Chrome Mobile 47 which is the only version I have on a Samsung phone at the moment.

If you don't have many users, there are two workarounds:

  1. Ask user to install the Google Keyboard and enable it - see https://play.google.com/store/apps/details?id=com.google.android.inputmethod.latin

  2. Ask user to use the native browser (ask user to use the App with the world icon labelled "Internet").

Apps using WebView on Android 4.4 are stuck with Chrome 30 or 33 for the WebView, so I would guess that Samsung Android 4.4 phones using WebView are affected. Using WebView on any other version of Android shouldn't be affected (Android 4.3 or less used the native browser for the WebView and Android 5.0+ should use a version of Chrome without the bug because Chrome WebView updated).

Also relevant is Samsung browser versions by phone and comments about the Samsung browser.

robocat
  • 5,293
  • 48
  • 65
  • I actually detect for 99% of Samsung phones in my country to avoid this bug by testing for webkit version >= 537 and `/; (SAMSUNG[- ])?(GT|SM)-[IGNPST]\d\d\d/.test(navigator.userAgent);` although for other countries the RegExp needs to be expanded to include more models - see http://androidforums.com/android-lounge/441957-identifying-samsung-galaxy-s2-lte-models.html and one should check for Chrome in the user agent too. – robocat Jul 25 '14 at 08:50
1

Use type="tel" for those Samsung devices with wrongly implemented support for type="number". Other approaches details here: Samsung Galaxy Tablet does not allow entering floating point numbers to inputs with "number" type

Community
  • 1
  • 1
maxweber
  • 576
  • 1
  • 5
  • 12