Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1538] TextField and TextArea has crashed with an uncaught exception 'NSRangeException'.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-11-05T23:26:50.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsTCSupportTriage, iOS, iPad
ReporterKosuke Isobe
AssigneeMauro Parra-Miranda
Created2014-10-16T05:32:55.000+0000
Updated2016-03-08T07:37:59.000+0000

Description

Have specified maxLength property, it will crash if try to paste the characters even more. Test code:
var win = Ti.UI.createWindow();
var tf = Ti.UI.createTextField({
  width: Ti.UI.FILL,
  maxLength: 100
});
win.add(tf);
win.open();
Test case: 1. Input in TextField or TextArea "aaaaaaaaaa" 2. Copy the "aaaaaaaaaa" 3. Paste the "aaaaaaaaaa" * 10 times 4. Press the Undo on keyboard 5. App will crash

Attachments

FileDateSize
log2014-10-16T05:32:55.000+00009492

Comments

  1. Harish Mridha 2014-10-17

    Hi, We tried to reproduce this issue with a sample test case. It’s not a valid bug. Any attempt to input text beyond the length (including pasting a string larger than maxLength) will not edit the field's contents.

    TESTING ENVIRONMENT:

    Ti SDK 3.4.0.GA Ti CLI 3.4.0 Mac OS X 10.9.5 iPad v8.0

    TEST CODE:

     
       var win = Ti.UI.createWindow({
       	backgroundColor:'white'
       });
       var tf = Ti.UI.createTextField({
       	top:50,
       	backgroundColor: 'red',
         	width: Ti.UI.FILL,
        	maxLength: 100
       });
       win.add(tf);
       win.open();
       

    STEPS TO TEST:

    - Create a simple project. - Update project with test code - Run on iOS device

    EXPECTED RESULT:

    It’s working as expected. Thanks

JSON Source