[TIMOB-28556] iOS: Drag-and-dropped text into TextArea will crash on iOS 15 if it exceeds maxLength
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-10-19T12:42:10.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 10.1.1 |
Components | iOS |
Labels | TextArea, drag, drop, ios, ios-15, maxLength, paste |
Reporter | Jonas Funk Johannessen |
Assignee | Joshua Quick |
Created | 2021-10-12T07:08:12.000+0000 |
Updated | 2021-11-17T11:12:39.000+0000 |
Description
*Steps to reproduce:*
Build and run the below on iOS 15.
Tap and hold the top TextArea's text.
Tap on "Select All" in the context menu.
Tap and hold selected text until it becomes draggable.
Drag text into bottom TextArea.
Notice that the app crashes.
const window = Ti.UI.createWindow({
layout: "vertical",
backgroundColor: "white",
});
window.add(Ti.UI.createTextArea({
value: "Hello World! This is a test.",
borderWidth: 1,
top: 100,
width: "80%",
height: 80,
}));
window.add(Ti.UI.createTextArea({
value: "Paste text here.",
maxLength: 20,
borderWidth: 1,
top: 20,
width: "80%",
height: 80,
}));
window.open();
*Original Post:*
Our 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.
Attachments
File | Date | Size |
---|---|---|
ios15-paste-crash.txt | 2021-10-12T07:07:29.000+0000 | 1972 |
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. I 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
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
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.
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
Yes, it's just normal copy/pasting without dragging.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/13123
Backport PR: https://github.com/appcelerator/titanium_mobile/pull/13187