Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-17203

TextField keyboardType: parity issues between iOS and Android

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 3.3.0
    • Fix Version/s: Release 9.0.1
    • Component/s: Android, iOS
    • Labels:
    • Environment:

      TiSDK 3.3.0.v20140623161712
      iOS Sim 7.1
      Motorola Razr HD Android v4.1.1

    • Story Points:
      5

      Description

      KeyboardTypes KEYBOARD_NUMBER_PAD and KEYBOARD_DECIMAL_PAD do not act the same on iOS and Android.

      Steps to repro:

      0. Create a basic app with a window and add a textField to it (text field code is available below).
      1. Create a textField with a keyboardType of Ti.UI.KEYBOARD_NUMBER_PAD
      2. Run the app on iOS and Android
      3. Notice that on iOS there are numbers but no decimal point
      4. Notice on Android there are numbers and a decimal point, and you can type as many decimal points as you like.
      5. Create a textField with a keyboardType of Ti.UI.KEYBOARD_DECIMAL_PAD
      6. Run the app on iOS and Android
      7. Notice that on iOS there are numbers and a decimal point, and you can type as many decimal points as you like.
      8. Notice on Android there are numbers and a decimal point, but you can only type one decimal point.

      In our documentation is says: "Use a keyboard with decimal numbers only".
      http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI-property-KEYBOARD_DECIMAL_PAD
      So this seems like it would be correct behavior of Android, but it is not consistent across both platforms.

      Workaround

      Set different keyboardtypes for iOS and Android

      var ipAddress = Ti.UI.createTextField({
              hintText: 'IP Address',
              top: 10,
              height: 40,
              borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
              autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
              keyboardType: (Ti.Platform.name === 'android') ? Ti.UI.KEYBOARD_NUMBER_PAD : Ti.UI.KEYBOARD_DECIMAL_PAD
          });
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ybanev Yordan Banev
                Reporter:
                jalter Jon Alter
                Reviewer:
                Gary Mathews
                Tester:
                Satyam Sekhri
              • Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration