Affects Version/s: None
Fix Version/s: Release 9.1.0
Sprint:2020 Sprint 9, 2020 Sprint 10, 2020 Sprint 11, 2020 Sprint 12, 2020 Sprint 13, 2020 Sprint 14
When using a TextField with "keyboardType" set to KEYBOARD_TYPE_DECIMAL_PAD or KEYBOARD_TYPE_NUMBERS_PUNCTUATION, the end-user is only allowed to enter a period '.' for the decimal point. It ignores the current locale and does not allow other types of decimal separators such as a comma ',' which is used Europe and South America.
How to add languages on Android:
- Go to Android's main Settings screen.
- Tap on "System".
- Tap on "Language & Input".
- Tap on "Languages".
- Tap on "Add Language".
- Select a European language such as "German"/"Deutsch".
- Drag-and-drop the language to the top of the list.
Steps to reproduce:
- Build and run the below code on Android.
- Select a European language. (See language instructions above.)
- Tap on the TextField.
- Attempt to enter 1,5 with a comma.
- Notice it won't let you use a comma ',' for the decimal separator.
- Enter 1.5 with a period.
- Notice that it allows a period, but this is not correct for the current locale.
This is actually a bug on Google's end. They have a fix for it as of Android 8.0 by using passing the current Locale to a DigitsKeyListener constructor.
Unfortunately, Google's fix is incomplete and has the following issues:
- Fullscreen edits (when in landscape) is not fixed. Only allows period for decimal point.
- Does not support Arabic decimal separator at all.
- Android OS versions older than 8.0 can't use their fix. We need a solution for Android 4.4 too.
In Denmark the decimal separator is comma (,)
But when setting
Titanium Shows a keyboard with a dot (.) instead...
And when parsing a value with Danish Locale 20.50 becomes 2050
On IOS the keyboard is shown with a comma (,) and everything works as expected