{ "id": "176174", "key": "TIMOB-28433", "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": [], "resolution": null, "resolutiondate": null, "created": "2021-04-30T11:50:00.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2021-05-01T01:49:46.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "When setting the value of a text field (e.g. to force uppercase in our case), the keyboard resets, which is a pretty bad UX experience when entering numbers and letters in mix (like flight numbers).\r\n\r\nTest case:\r\n{code:js}\r\nconst window = Ti.UI.createWindow({ backgroundColor: '#f0f0f0' });\r\nconst textField = Ti.UI.createTextField({ width: 300, height: 40, backgroundColor: '#fff' });\r\n\r\ntextField.addEventListener('change', event => {\r\n event.source.value = event.source.value.toUpperCase();\r\n});\r\n\r\nwindow.add(textField);\r\nwindow.open();\r\n{code}\r\n\r\nThis does only happen on Android - iOS works correctly. If there is a workaround to force uppercase, I am happy to use that instead! Android natively solves this by using {{textAllCaps}} in the {{EditText}}, but unfortunately thats not available in Titanium.", "attachment": [], "flagged": false, "summary": "Android: Setting value resets keyboard layout (parity issue)", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "458640", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel], we actually do support an all-caps features in Titanium. You can enable it by setting the {{TextField}} \"autocapitalization\" property to {{Ti.UI.TEXT_AUTOCAPITALIZATION_ALL}}. It works on both Android and iOS.\r\nhttps://titaniumsdk.com/api/titanium/ui/textfield.html#autocapitalization\r\n\r\nI don't know if we can do anything about the virtual keyboard relayout after calling setText().\r\n\r\nThat said, the *BEST* way to handle altering keyboard input before it's applied to the {{EditText}} is to do so synchronously via a native [InputFilter|https://developer.android.com/reference/android/text/InputFilter] and [KeyListener|https://developer.android.com/reference/android/text/method/KeyListener]... which is exactly what we use to apply auto-capitalization, max length, emoji filtering, etc. So, we're already doing the *right* thing as can be seen [here|https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIText.java#L970] . Since Android is a bit fussy on how these are configured, it's probably best to add these as filtering features like this.\r\n\r\nDoes this help?", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-05-01T01:48:58.000+0000", "updated": "2021-05-01T01:49:46.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }