{ "id": "175954", "key": "TIMOB-28312", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "21177", "name": "Release 9.3.1", "archived": false, "released": true, "releaseDate": "2021-01-26" } ], "resolution": null, "resolutiondate": null, "created": "2021-01-13T00:52:43.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "TextField", "android", "decimal", "locale", "localization" ], "versions": [ { "id": "20950", "name": "Release 9.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "issuelinks": [ { "id": "59097", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "174332", "key": "TIMOB-27616", "fields": { "summary": "Android: TextField with decimal keyboard type does not allow comma for decimal separator", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-01-19T21:10:31.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nSome Android devices such as Samsung and Huawei do not have localized decimal keyboards. They only support a decimal point '.' which makes it impossible to enter a decimal separator into a {{TextField}} for locales that use a decimal comma ',' character.\r\n\r\nThis never happens in the Android emulator or Google's own devices.\r\n\r\nThis is actually a bug with some 3rd party devices, not in Titanium. We can't control the localization of the virtual keyboard. But that said, we need a work-around of some kind.\r\n\r\n*Steps to reproduce:*\r\n# Acquire a Samsung or Huawei Android device.\r\n# Go to: {{Settings -> System -> Languages & Input -> Languages}}\r\n# Select a European language such as French or German.\r\n# Build and run the below code.\r\n# Tap on the {{TextField}}.\r\n# Notice keyboard has a \",\" button but not a \".\" button. _(We can't fix this.)_\r\n# Attempt to enter a decimal value such as {{1,5}} or {{1.5}}.\r\n# Notice you can't enter a decimal separator. _(This is only an issue on some devices.)_\r\n\r\n{code:javascript}\r\nconst value = 1234.5;\r\nconst window = Ti.UI.createWindow();\r\nconst textField = Ti.UI.createTextField({\r\n\tvalue: value.toLocaleString(Ti.Locale.currentLocale),\r\n\tkeyboardType: Ti.UI.KEYBOARD_TYPE_DECIMAL_PAD,\r\n\twidth: \"80%\",\r\n});\r\ntextField.addEventListener(\"change\", (e) => {\r\n\tconsole.log(\"@@@ value: \" + Ti.Locale.parseDecimal(e.value));\r\n});\r\nwindow.add(textField);\r\nwindow.open();\r\n{code}\r\n\r\n*Recommended Solution:*\r\nFor locales that do not use a decimal point, we should automatically substitute the \".\" character as it's typed in. This would also mean we won't allow user's to enter a thousands separator for European locales, but unfortunately there doesn't appear to be any other solution to this issue.\r\n", "attachment": [], "flagged": false, "summary": "Android: Can't enter decimal comma in TextField on some devices", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1215, "state": "closed", "name": "2021 Sprint 2", "startDate": "2021-01-18T20:36:00.000Z", "endDate": "2021-01-29T20:36:00.000Z", "completeDate": "2021-01-31T17:42:28.052Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "457998", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/12382", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-01-13T01:20:06.000+0000", "updated": "2021-01-13T01:20:06.000+0000" }, { "id": "458046", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master, backport PR to 9_3_X merged for 9.3.1 target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-01-19T20:43:52.000+0000", "updated": "2021-01-19T21:10:28.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }