{ "id": "168500", "key": "TIMOB-24851", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-11-28T23:00:39.000+0000", "created": "2017-06-19T19:44:58.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "breaking-change", "label", "wordwrap" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-11-29T15:10:14.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": "*Summary:*\r\nThe {{Ti.UI.Label}} \"wordWrap\" property is Android only (ie: not portable). When set {{false}}, newline {{'\\n'}} characters are ignored and the label is put into single-line mode.\r\n\r\nThis property is unnecessary and should be ignored/deprecated.\r\n\r\n*Reason 1:*\r\nIf you want newline {{'\\n'}} characters to be ignored, then you should remove them from the string yourself before applying them to the label. For example:\r\n{code:javascript}\r\nvar myString = \"Test1\\nTest2\\nTest3\";\r\nvar label = Ti.UI.createLabel({\r\n\ttext: myString.replace(/\\n/g, \"\"),\r\n});\r\n{code}\r\n\r\n*Reason 2:*\r\nIf you want to limit a label's text to 1 line, then you should set the \"maxLines\" property to 1. This property is supported on all platforms and will show ellipsis (enabled by default) if the text does not fit within the label. It also honors newlines characters too and would show ellipsis where the line break occurs.\r\n{code:javascript}\r\nvar label = Ti.UI.createLabel({\r\n\ttext: \"This is line 1.\\nLine 2 cannot be seen.\",\r\n\tmaxLines: 1,\r\n});\r\n{code}\r\n\r\n*Reason 3:*\r\nSetting a width on a label implies a wrapping width already, making the \"wordWrap\" property redundant. And if you don't want to word wrap (and honor newlines), then you can set the label's width to {{Ti.UI.SIZE}} (the default setting) and put it into a horizontal {{ScrollView}}.\r\n", "attachment": [], "flagged": false, "summary": "Android: Deprecate Label \"wordWrap\" property (it's not needed)", "creator": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1008, "state": "closed", "name": "2018 Sprint 06 SDK", "startDate": "2018-03-11T22:18:04.396Z", "endDate": "2018-03-25T22:18:00.000Z", "completeDate": "2018-03-25T21:52:36.683Z", "originBoardId": 216 } ], "comment": { "comments": [ { "id": "422270", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9160", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-19T20:03:58.000+0000", "updated": "2017-06-19T20:03:58.000+0000" }, { "id": "435406", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reference to our discussion about this issue here:\r\nhttps://github.com/appcelerator/titanium_mobile/pull/9161#pullrequestreview-45374947\r\n\r\nWe may want to re-evaluate the usefulness of this property. Especially since iOS does not support it.\r\n(Windows does. We should double check that platform's behavior.)\r\n\r\nIn my opinion, setting the label's width already implies that the developer wants it to word/line-wrap the text at that position. So, I think the \"wordWrap\" property is useless. If the developer wants the label to be single-line, then setting the \"maxLines\" property to 1 will do the job. And if developers wants the newline '\\n' characters ignored, then they can string replace or remove the characters themselves.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-09T02:34:58.000+0000", "updated": "2018-03-09T02:34:58.000+0000" }, { "id": "437546", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nWaiting for merger to get enabled.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-09T21:52:35.000+0000", "updated": "2018-05-09T21:52:35.000+0000" }, { "id": "437550", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~lchoudhary], this is a breaking change. Especially since I've seen customer code use this property.\r\nI think this should be pushed out to Titanium 8.0.0.\r\n\r\n_Note:_\r\n_I would go a step further and deprecate the {{wordWrap}} property and have it log a warning. The width assigned to the label implies the word wrapping width. So, the {{wordWrap}} property is useless._", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-10T02:00:11.000+0000", "updated": "2018-05-10T02:24:20.000+0000" }, { "id": "443718", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10480", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-17T04:22:55.000+0000", "updated": "2018-11-17T04:22:55.000+0000" }, { "id": "443798", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-21T01:06:35.000+0000", "updated": "2018-11-21T01:06:35.000+0000" }, { "id": "444022", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-28T23:00:35.000+0000", "updated": "2018-11-28T23:00:35.000+0000" }, { "id": "444049", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*. Verified fix in SDK version {{8.0.0.v20181128164557}}.\r\n\r\n*Test and other information can be found at:*\r\nhttps://github.com/appcelerator/titanium_mobile/pull/10480", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-29T15:10:07.000+0000", "updated": "2018-11-29T15:10:07.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }