{ "id": "127947", "key": "AC-762", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-04-06T05:57:44.000+0000", "created": "2014-03-21T12:47:58.000+0000", "labels": [ "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:01.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I have TextArea control which accept only decimal numeric values. Inserted value is validate on 'change' event and if it is not valid then value of TextArea is set to last valid string.\r\n\r\nIn case when not valid character is inserted and then UNDO key is pressed on numeric iOS keyboard, application crashed with following message:\r\n\r\n[ERROR] The application has crashed with an uncaught exception 'NSRangeException'.(check attachment for more info)\r\n\r\nSteps to reproduce on Test case :\r\n1. Press on Text area in the middle of the screen in order to change focus on it \r\n2. When keyboard is opened press on some symbol(e.g. \"@\" ), text area should be empty\r\n3. Press on \"Undo\" key on keyboard => Application will crash", "attachment": [ { "id": "46808", "filename": "app.js", "author": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-24T09:50:00.000+0000", "size": 760, "mimeType": "application/javascript" }, { "id": "46789", "filename": "log", "author": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-21T12:47:58.000+0000", "size": 4299, "mimeType": "application/octet-stream" }, { "id": "46886", "filename": "Screen Shot 2014-03-26 at 9.11.58 AM.png", "author": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-26T08:20:09.000+0000", "size": 67339, "mimeType": "image/png" } ], "flagged": false, "summary": "Unhanded exception 'NSRangeException' when Undo key is pressed on iOS numeric keyboard", "creator": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Command-Line Interface, CLI version 3.2.0, Titanium SDK version 3.2.0.GA\r\nXcode\r\n 5.0.2 (build 5A3005) - Xcode default\r\n Install Location = /Applications/Xcode 2.app/Contents/Developer\r\n iOS SDKs = 7.0.3\r\n iOS Simulators = 7.0.3\r\n Supported by TiSDK 3.2.0.GA = yes", "comment": { "comments": [ { "id": "298241", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for attaching the log file but to evaluate further we need a simple runnable test case. Can you please attach the same?", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-21T16:58:39.000+0000", "updated": "2014-03-21T16:58:39.000+0000" }, { "id": "298389", "author": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test case attached.", "updateAuthor": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-24T09:50:00.000+0000", "updated": "2014-03-24T09:50:00.000+0000" }, { "id": "298524", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This appears to be a test case issue. You are using a keyboard that supports only numeric characters. If you type in numeric characters and then undo, everything works fine and there is no crash. If you type in a symbol using your computer as numeric keyboard does not support this character, you are stripping this symbol in test case and setting the numeric value so undo becomes invalid at this point and causes program to malfunction.\n\n{code}\n var val = textArea.value;\n Ti.API.info(\"val = \" + val);\n val = val.replace(/[^\\d\\.\\,]/g, \"\");\n val = val.replace(/,/g, '.');\n Ti.API.info(\"Modified val = \" + val);\n textArea.setValue(val);\n\nOutput:\n[INFO] : val = 1\n[INFO] : Modified val = 1\n[INFO] : val = 12\n[INFO] : Modified val = 12\n[INFO] : val = 123\n[INFO] : Modified val = 123\n[INFO] : val = 123@\n[INFO] : Modified val = 123\n[INFO] : val = 123@\n[INFO] : Modified val = 123\n{code}", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-25T04:36:23.000+0000", "updated": "2014-03-25T04:36:23.000+0000" }, { "id": "298539", "author": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "body": "But it is not expect application to crash when user accidentally press on a valid buttons on the keyboard.", "updateAuthor": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-25T08:06:03.000+0000", "updated": "2014-03-25T08:06:03.000+0000" }, { "id": "298739", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can you please explain how the user is going to type a symbol on a numeric keypad?", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-26T03:20:06.000+0000", "updated": "2014-03-26T03:20:06.000+0000" }, { "id": "298763", "author": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please check screenshot in attachment.", "updateAuthor": { "name": "goran.krstevski", "key": "goran.krstevski", "displayName": "Goran Krstevski", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-26T08:20:09.000+0000", "updated": "2014-03-26T08:20:09.000+0000" }, { "id": "298908", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks. The issue here is that you are modifying the user entered value dynamically. For example, if a user types \"123@\" then you are replacing it with \"123\" and that string is shorter than the user typed string. Undo Manager tries to undo 4 characters and finds only 3 characters and throws out of range exception. You should either not modify the string or replace an undesired character with space.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-27T04:42:17.000+0000", "updated": "2014-03-27T04:42:17.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }