{ "id": "176305", "key": "TIMOB-28556", "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": "21265", "description": "", "name": "Release 10.1.1", "archived": false, "released": true, "releaseDate": "2021-11-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-10-19T12:42:10.000+0000", "created": "2021-10-12T07:08:12.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "TextArea", "drag", "drop", "ios", "ios-15", "maxLength", "paste" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-11-17T11:12:39.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Steps to reproduce:*\r\n# Build and run the below on iOS 15.\r\n# Tap and hold the top TextArea's text.\r\n# Tap on \"Select All\" in the context menu.\r\n# Tap and hold selected text until it becomes draggable.\r\n# Drag text into bottom TextArea.\r\n# Notice that the app crashes.\r\n\r\n{code:javascript}\r\nconst window = Ti.UI.createWindow({\r\n\tlayout: \"vertical\",\r\n\tbackgroundColor: \"white\",\r\n});\r\nwindow.add(Ti.UI.createTextArea({\r\n\tvalue: \"Hello World! This is a test.\",\r\n\tborderWidth: 1,\r\n\ttop: 100,\r\n\twidth: \"80%\",\r\n\theight: 80,\r\n}));\r\nwindow.add(Ti.UI.createTextArea({\r\n\tvalue: \"Paste text here.\",\r\n\tmaxLength: 20,\r\n\tborderWidth: 1,\r\n\ttop: 20,\r\n\twidth: \"80%\",\r\n\theight: 80,\r\n}));\r\nwindow.open();\r\n{code}\r\n\r\n*Original Post:*\r\nOur users have started to report that pasting text into a Ti.UI.TextArea, will crash the app. The crash has started to happen recently and only on iOS 15. Below is attached a crash report from Crashlytics. ", "attachment": [ { "id": "68003", "filename": "ios15-paste-crash.txt", "author": { "name": "jonasfunk", "key": "jonasfunk", "displayName": "Jonas Funk Johannessen", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-12T07:07:29.000+0000", "size": 1972, "mimeType": "text/plain" } ], "flagged": false, "summary": "iOS: Drag-and-dropped text into TextArea will crash on iOS 15 if it exceeds maxLength", "creator": { "name": "jonasfunk", "key": "jonasfunk", "displayName": "Jonas Funk Johannessen", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jonasfunk", "key": "jonasfunk", "displayName": "Jonas Funk Johannessen", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 9.2.2.GA", "comment": { "comments": [ { "id": "459097", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "I've tried to check this out but pasting into a TextArea (including normal text, special characters, and attributed strings) seems to work ok for me.\r\n\r\nI did manage to track down [this post|https://qiita.com/Yaruki00/items/219902185610b52a7a0d] that looks to be similar and is caused by the new drag and drop copy/paste action. Maybe this isn't playing nicely with one of the existing properties like editable/enableCopy", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2021-10-14T14:19:20.000+0000", "updated": "2021-10-14T14:19:20.000+0000" }, { "id": "459098", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Yes looks to be drag and drop paste + maxLength. Highlight the first text then drag and drop in the second textArea and it will crash\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tlayout: 'vertical'\r\n});\r\nvar textArea = Ti.UI.createTextArea({\r\n\ttop: 100,\r\n\tvalue: 'I am a textarea',\r\n});\r\nwin.add(textArea);\r\nvar textArea2 = Ti.UI.createTextArea({\r\n\twidth: 300, height : 70,\r\n\tborderColor: 'black',\r\n\tmaxLength: 2\r\n});\r\nwin.add(textArea2);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2021-10-14T14:28:04.000+0000", "updated": "2021-10-14T14:28:04.000+0000" }, { "id": "459099", "author": { "name": "jonasfunk", "key": "jonasfunk", "displayName": "Jonas Funk Johannessen", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I was able to reproduce this issue once. Some of our users say that it happens every time they try to paste something into the texarea. I've talked to one person who sent some text to himself via Facebook Messenger, copied that text, and inserted into the app leading to crash. I wondered if could be something with formatting, so I asked him to try to select some text from web > share > copy and paste. [This trick should remove formatting|https://apple.stackexchange.com/questions/354992/how-to-copy-and-paste-as-plain-text-on-ios/377691]. Still crash. ", "updateAuthor": { "name": "jonasfunk", "key": "jonasfunk", "displayName": "Jonas Funk Johannessen", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-14T14:31:49.000+0000", "updated": "2021-10-14T14:31:49.000+0000" }, { "id": "459100", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Are they just using the normal copy/paste dialog? I can reproduce the stack you have only with the drag and drop copy paste + maxLength\r\n\r\n{code}\r\n2021-10-14 15:32:49.183066+0100 Titanium[7956:678901] *** Assertion failure in -[_UITextKitTextPosition compare:], UITextKitTextViewEditingSupport.m:43\r\n2021-10-14 15:32:49.198140+0100 Titanium[7956:678901] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: pos'\r\n*** First throw call stack:\r\n(\r\n\t0 CoreFoundation 0x00007fff203fbbb4 __exceptionPreprocess + 242\r\n\t1 libobjc.A.dylib 0x00007fff2019ebe7 objc_exception_throw + 48\r\n\t2 Foundation 0x00007fff20750c12 _userInfoForFileAndLine + 0\r\n\t3 UIKitCore 0x00007fff253b5b68 -[_UITextKitTextPosition compare:] + 235\r\n\t4 UIKitCore 0x00007fff253a8e77 -[UITextInputController comparePosition:toPosition:] + 85\r\n\t5 UIKitCore 0x00007fff253ca315 -[UITextView comparePosition:toPosition:] + 85\r\n\t6 UIKitCore 0x00007fff2536fc4d -[UITextPasteController _clampRange:] + 634\r\n\t7 UIKitCore 0x00007fff253703c0 __87-[UITextPasteController _performPasteOfAttributedString:toRange:forSession:completion:]_block_invoke + 40\r\n\t8 UIKitCore 0x00007fff253705c8 __87-[UITextPasteController _performPasteOfAttributedString:toRange:forSession:completion:]_block_invoke.174 + 184\r\n\t9 UIKitCore 0x00007fff253b1cec -[UITextInputController _pasteAttributedString:toRange:completion:] + 471\r\n\t10 UIKitCore 0x00007fff25370326 -[UITextPasteController _performPasteOfAttributedString:toRange:forSession:completion:] + 726\r\n\t11 UIKitCore 0x00007fff2536f603 __49-[UITextPasteController _executePasteForSession:]_block_invoke + 299\r\n\t12 libdispatch.dylib 0x0000000102e67a28 _dispatch_call_block_and_release + 12\r\n\t13 libdispatch.dylib 0x0000000102e68c0c _dispatch_client_callout + 8\r\n\t14 libdispatch.dylib 0x0000000102e77376 _dispatch_main_queue_callback_4CF + 1195\r\n\t15 CoreFoundation 0x00007fff2036985d __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9\r\n\t16 CoreFoundation 0x00007fff203640ba __CFRunLoopRun + 2772\r\n\t17 CoreFoundation 0x00007fff20363103 CFRunLoopRunSpecific + 567\r\n\t18 GraphicsServices 0x00007fff2c851cd3 GSEventRunModal + 139\r\n\t19 UIKitCore 0x00007fff24ffbe63 -[UIApplication _run] + 928\r\n\t20 UIKitCore 0x00007fff25000a53 UIApplicationMain + 101\r\n\t21 Titanium 0x00000001028c12c6 main + 806\r\n\t22 dyld 0x0000000102ce5e1e start_sim + 10\r\n\t23 ??? 0x0000000000000001 0x0 + 1\r\n\t24 ??? 0x0000000000000001 0x0 + 1\r\n)\r\n{code}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2021-10-14T14:41:17.000+0000", "updated": "2021-10-14T14:41:17.000+0000" }, { "id": "459101", "author": { "name": "jonasfunk", "key": "jonasfunk", "displayName": "Jonas Funk Johannessen", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, it's just normal copy/pasting without dragging. ", "updateAuthor": { "name": "jonasfunk", "key": "jonasfunk", "displayName": "Jonas Funk Johannessen", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-14T14:45:53.000+0000", "updated": "2021-10-14T14:45:53.000+0000" }, { "id": "459103", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/13123", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-15T01:02:45.000+0000", "updated": "2021-10-15T01:02:45.000+0000" }, { "id": "459174", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Backport PR: https://github.com/appcelerator/titanium_mobile/pull/13187", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2021-11-17T11:12:39.000+0000", "updated": "2021-11-17T11:12:39.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }