{ "id": "112139", "key": "TIMOB-13364", "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": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-10-02T21:00:33.000+0000", "created": "2013-04-03T17:19:52.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2017-03-16T22:29:30.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "According to the docs, TextArea supports maxLength property from SDK 3.0. However, maxLength does not work in Android. \r\n\r\nIn TiUIText.java, the code that reads the maxLength is:\r\n\r\nif (d.containsKey(TiC.PROPERTY_MAX_LENGTH) && field) {\r\n maxLength = TiConvert.toInt(d, TiC.PROPERTY_MAX_LENGTH);\r\n}\r\n\r\nTextArea has \"field\" boolean set to false, so maxLength is always ignored.\r\n\r\nSteps to reproduce. Create simple App.js:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\nvar textArea = Ti.UI.createTextArea({\r\n borderWidth: 2,\r\n borderColor: '#bbb',\r\n borderRadius: 5,\r\n color: '#888',\r\n textAlign: 'left', \r\n maxLength: 10,\r\n top: 60,\r\n width: 300,\r\n height : 150\r\n});\r\nwin.add(textArea);\r\nwin.open();\r\n{code}\r\n\r\nLaunch app and start writing in the text area. You can enter more than 10 chars, despite maxLength is set to 10. Tested with SDK 3.0.0.GA in Android 2.3.3 and Android 4.1", "attachment": [], "flagged": false, "summary": "Android: TextArea maxLength not working in Android", "creator": { "name": "javierfp81", "key": "javierfp81", "displayName": "javier ferrero", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "3.0.2GA\r\nAndroid 4.1.2\r\nTitanium Studio, build: 3.1.0.201303032333", "closedSprints": [ { "id": 220, "state": "closed", "name": "2014 Sprint 20 SDK", "startDate": "2014-09-29T22:32:25.224Z", "endDate": "2014-10-13T18:25:00.000Z", "completeDate": "2014-10-13T18:25:45.560Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "245520", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Javier,\nWould you please post a simple test case that shows this bug? Providing a test case for issues allows for a much quicker and smoother review and turnaround time. Once a valid test case is provided we can continue to process the bug. For reference:\nhttps://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report\nThank you for your assistance,\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-03T20:25:17.000+0000", "updated": "2013-04-03T20:25:17.000+0000" }, { "id": "245692", "author": { "name": "javierfp81", "key": "javierfp81", "displayName": "javier ferrero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Added test case.\n\nRegards\n", "updateAuthor": { "name": "javierfp81", "key": "javierfp81", "displayName": "javier ferrero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-04T11:14:16.000+0000", "updated": "2013-04-04T11:14:16.000+0000" }, { "id": "245708", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and confirmed, maxLength is not working atm. Moved to Ti-Mobile.\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-04T15:14:08.000+0000", "updated": "2013-04-04T15:14:08.000+0000" }, { "id": "248122", "author": { "name": "anandt", "key": "anandt", "displayName": "Anand T", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduced in 3.1.0GA also", "updateAuthor": { "name": "anandt", "key": "anandt", "displayName": "Anand T", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-18T08:15:35.000+0000", "updated": "2013-04-18T08:15:35.000+0000" }, { "id": "318809", "author": { "name": "FrancoisM", "key": "francoism", "displayName": "François Mériaux", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The issue is still going on with 3.3.0 GA. It is really an annoying problem for all the apps that allow to write tweets.\r\n\r\nI guess a solution would be to remove the condition on \"field\" in TiUIText.java : turn \r\n\r\n{code:java}\r\nif (d.containsKey(TiC.PROPERTY_MAX_LENGTH) && field) {\r\n maxLength = TiConvert.toInt(d.get(TiC.PROPERTY_MAX_LENGTH), -1);\r\n}\r\n{code}\r\n\r\ninto \r\n{code:java}\r\nif (d.containsKey(TiC.PROPERTY_MAX_LENGTH)) {\r\n maxLength = TiConvert.toInt(d.get(TiC.PROPERTY_MAX_LENGTH), -1);\r\n}\r\n{code}", "updateAuthor": { "name": "FrancoisM", "key": "francoism", "displayName": "François Mériaux", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-15T07:30:33.000+0000", "updated": "2014-08-15T08:04:51.000+0000" }, { "id": "326019", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Remove the check for textfield ('field') when setting maxLength as this is available to textArea also\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/6178", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-09-28T14:37:37.000+0000", "updated": "2014-09-28T14:37:37.000+0000" }, { "id": "335789", "author": { "name": "sagar patel", "key": "sagar patel", "displayName": "sagar k patel", "active": true, "timeZone": "America/Los_Angeles" }, "body": "HI Ingo,\r\n\r\nI am facing the in MaxLength property in TextArea in android, And i am using 3.4.1.GA SDK . Issue is still open in android.\r\nSo pls give some suggestion or solution so make it work for android", "updateAuthor": { "name": "sagar patel", "key": "sagar patel", "displayName": "sagar k patel", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-10T05:21:37.000+0000", "updated": "2014-12-10T05:21:37.000+0000" }, { "id": "413358", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T22:29:30.000+0000", "updated": "2017-03-16T22:29:30.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }