{ "id": "161023", "key": "TIMOB-23501", "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": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-08-24T23:28:01.000+0000", "created": "2016-06-10T19:52:52.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "parity", "qe-6.0.0" ], "versions": [], "issuelinks": [ { "id": "52018", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "161022", "key": "TIMOB-23500", "fields": { "summary": "Android: Ti.UI.Label.ellipsize should default to TruncateAt.END, but is undefined", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "52019", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "155985", "key": "TIMOB-20624", "fields": { "summary": "Parity: Combine unit tests for SDKs into common suite/repo", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-10-05T13:50:52.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": "According to docs, it should default to false. See https://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.ui.label.test.js#L95 for the unit test, but here's the snippet:\r\n{code:javascript}\r\nit('ellipsize', function () {\r\n\t\tvar label = Ti.UI.createLabel({\r\n\t\t\ttext: 'this is some text'\r\n\t\t});\r\n\t\tshould(label.ellipsize).be.a.Boolean; // undefined on iOS\r\n\t\tshould(label.getEllipsize).be.a.Function;\r\n\t\tshould(label.ellipsize).eql(false);\r\n\t\tshould(label.getEllipsize()).eql(false);\r\n\t\tlabel.ellipsize = true;\r\n\t\tshould(label.getEllipsize()).eql(true);\r\n\t\tshould(label.ellipsize).eql(true);\r\n\t});\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Ti.UI.Label.ellipsize should default to Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END, but is undefined", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "environment": null, "closedSprints": [ { "id": 649, "state": "closed", "name": "2016 Sprint 13 SDK", "startDate": "2016-06-18T00:25:17.303Z", "endDate": "2016-07-02T00:25:00.000Z", "completeDate": "2016-07-04T04:25:16.889Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "388322", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": " The ellipsize property isn't actually a boolean we just allow booleans to be passed in for parity with android(or atleast thats what it says in the code) as they have different constants. For iOS the default is NSLineBreakByTruncatingTail, we are actually setting this [property|https://developer.apple.com/library/ios/documentation/UIKit/Reference/UILabel_Class/#//apple_ref/occ/instp/UILabel/lineBreakMode]. On iOS its returning null because its never set through the proxy so the proxy doesn't contain any value, if you were to grab any property out that label for example the height it will also return null/nil. ", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-06-14T18:17:15.000+0000", "updated": "2016-06-14T18:17:51.000+0000" }, { "id": "388764", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "My 2 cents: As we can only set Number-constants, I wonder why Android could even return false in any case. So we should return the {{Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END}} in both platforms by default.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-06-21T18:30:33.000+0000", "updated": "2016-06-21T18:30:33.000+0000" }, { "id": "389056", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR:https://github.com/appcelerator/titanium_mobile/pull/8086\r\n\r\n* Updated the Docs\r\n* Will return Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END (4) by default for IOS\r\n* Added 3 new constants that are iOS as we already have one constant thats android only.\r\n\r\nAndroid doesn't have a default value set for the ellipsis property.We need to change it to default to Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END\r\nDemo code:\r\n{code:javascript}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n});\r\n\r\nvar label = Ti.UI.createLabel({\r\n color: '#900',\r\n text: 'Ellipsize',\r\n width: 100, \r\n height: 100,\r\n});\r\n\r\nlabel.addEventListener(\"click\",function(e){\r\n\tTi.API.info(label.getEllipsize());\r\n})\r\nwin.add(label);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-06-24T21:01:09.000+0000", "updated": "2016-06-29T22:36:41.000+0000" }, { "id": "389478", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR approved! Additional test-code for unit-testing:\r\n{code:javascript}\r\nvar label = Ti.UI.createLabel();\r\n\r\nTi.API.warn(label.getEllipsize() == Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END); // Should be \"true\"\r\nTi.API.warn(label.getEllipsize() == Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MIDDLE); // Should be \"false\"\r\n\r\nlabel.setEllipsize(Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MIDDLE);\r\n\r\nTi.API.warn(label.getEllipsize() == Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_MIDDLE); // Should be \"true\"\r\nTi.API.warn(label.getEllipsize() == Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END); // Should be \"false\"\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-06-29T22:37:07.000+0000", "updated": "2016-06-29T22:37:07.000+0000" }, { "id": "389482", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cwilliams] We now use {{Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END}} by default on both platforms, making Android looking better by default as well. We left the boolean-check for legacy-purposes and ultimately need to update the unit tests. See my above comment regarding default-values. Thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-06-29T23:01:36.000+0000", "updated": "2016-06-29T23:01:36.000+0000" }, { "id": "394033", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~apetkov] So. Ti.UI.Label.ellipsize should return a constant in both android and iOS. there's no true / false going on anymore. However, I just ran a unit test on it and realised that {{label.ellipsize}} doesn't return a number. Can you investigate?\r\n\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'gray'\r\n});\r\n \r\nvar label = Ti.UI.createLabel({\r\n text: 'this is some text'\r\n});\r\n\r\n// This is Android-only\r\nif (Ti.Platform.osname == \"android\") {\r\n Ti.API.info('wordwrap: ' + label.wordWrap);\r\n}\r\n\r\n// This is cross-platform\r\nTi.API.info('ellipsize: ' + label.ellipsize);\r\nTi.API.info(\"Default value correct? \" + (label.ellipsize == Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END));\r\n\r\nwin.add(label);\r\nwin.open();\r\n{code}\r\n\r\nh4. Expected Result\r\nlabel.ellipsize should return a default number. Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END.", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-08-24T03:34:35.000+0000", "updated": "2016-08-24T21:11:24.000+0000" }, { "id": "394034", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Note to QE: description was based on this property being true/false. but it's actually a number so check for number.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-08-24T03:35:48.000+0000", "updated": "2016-08-24T03:35:48.000+0000" }, { "id": "394120", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Removing parameter from proxy getter method fixed issue. \r\n* PR: https://github.com/appcelerator/titanium_mobile/pull/8255\r\n* PR (6.0.X): https://github.com/appcelerator/titanium_mobile/pull/8256", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-08-24T17:10:49.000+0000", "updated": "2016-08-24T20:39:15.000+0000" }, { "id": "394151", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cng] Updated your example code to:\r\n- Make {{wordwrap}} Android-only in your test-case (since it is)\r\n- Do a logical comparison to check if the default-value matches the docs (it does)\r\n\r\n[~apetkov] iOS works great, can you verify Android as well? I'll merge afterwards.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-24T19:17:55.000+0000", "updated": "2016-08-24T19:17:55.000+0000" }, { "id": "394285", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel] Im still getting undefined for wordWrap on android. Added a 6.0.0 backport in the comment above, once android is resolved. ", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-08-24T20:40:28.000+0000", "updated": "2016-08-24T20:40:28.000+0000" }, { "id": "394336", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-08-25T02:15:52.000+0000", "updated": "2016-08-25T02:15:52.000+0000" }, { "id": "398115", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, {{label.ellipsize}} returns a default numerical value, and is no longer undefined.\r\n\r\nTested On:\r\niPhone 6 Plus 10.0.2 Device\r\niPhone 5S 9.3.5 Device\r\nMac OSX El Capitan 10.11.6\r\nTi SDK: 6.0.0.v20161004202820\r\nAppc Studio: 4.8.0.201609292239\r\nAppc NPM: 4.2.8-7\r\nApp CLI: 6.0.0-56\r\nXcode 8.0 \r\nNode v4.4.7\r\n\r\n*Closing ticket.*", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-10-05T13:50:29.000+0000", "updated": "2016-10-05T13:50:29.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }