{ "id": "168002", "key": "TIMOB-24753", "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": "19572", "description": "Important fixes for 6.1.0", "name": "Release 6.1.1", "archived": false, "released": true, "releaseDate": "2017-06-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-06-09T14:49:45.000+0000", "created": "2017-05-31T00:18:27.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios", "layout", "qe-6.1.1", "regression" ], "versions": [ { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "issuelinks": [ { "id": "54993", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "inwardIssue": { "id": "160240", "key": "TIMOB-23391", "fields": { "summary": "iOS: View is not getting horizontally wrapped properly.", "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 } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-12T13:52:34.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": "After updating to 6.1.0.GA my apps are calculating percentages of views incorrectly. \r\nIf I have a view with *horizontal* layout and I create a child *Label* with let's say *90%* of width, it will be wrapped to the next line and use way more than 90% of width.\r\n\r\nExample:\r\n\r\n*index.xml*\r\n{code:java}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\n*index.tss*\r\n{code:java}\r\n\"#row\": {\r\n top: '50%',\r\n borderWidth: 1,\r\n width: '95%',\r\n right: 0,\r\n height: 50,\r\n layout: \"horizontal\"\r\n}\r\n\r\n\"#vwCheck\": {\r\n borderWidth: 1,\r\n height: Ti.UI.FILL,\r\n width: 44\r\n}\r\n\r\n\"#lbl\": {\r\n width: '100%',\r\n borderWidth: 1,\r\n minimumFontSize: 16,\r\n left: 0,\r\n font: {\r\n fontSize: '20dp',\r\n }\r\n}\r\n{code}\r\n\r\nExpected result (Works on 6.0.2.GA):\r\n!Screen Shot 2017-05-31 at 10.14.01 am.png|thumbnail!\r\n\r\nActual result (On 6.1.0.GA):\r\n!Screen Shot 2017-05-31 at 10.15.42 am.png|thumbnail!\r\n\r\nSetting my label width to 87% produces (6.1.0.GA):\r\n!Screen Shot 2017-05-31 at 10.16.42 am.png|thumbnail!\r\n\r\nAnd setting the label width to 88% (6.1.0.GA):\r\n!Screen Shot 2017-05-31 at 10.16.52 am.png|thumbnail!\r\n\r\n\r\n\r\n\r\n", "attachment": [ { "id": "62303", "filename": "Bildschirmfoto 2017-05-31 um 13.59.48.png", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-31T12:00:16.000+0000", "size": 318599, "mimeType": "image/png" }, { "id": "62302", "filename": "Screen Shot 2017-05-31 at 10.14.01 am.png", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2017-05-31T00:14:13.000+0000", "size": 10439, "mimeType": "image/png" }, { "id": "62301", "filename": "Screen Shot 2017-05-31 at 10.15.42 am.png", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2017-05-31T00:15:52.000+0000", "size": 2511, "mimeType": "image/png" }, { "id": "62300", "filename": "Screen Shot 2017-05-31 at 10.16.42 am.png", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2017-05-31T00:17:09.000+0000", "size": 9898, "mimeType": "image/png" }, { "id": "62299", "filename": "Screen Shot 2017-05-31 at 10.16.52 am.png", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2017-05-31T00:17:40.000+0000", "size": 2649, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: View sizes are incorrect in 6.1.0.GA (regression)", "creator": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "subtasks": [], "reporter": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "environment": "Titanium SDK 6.1.0.GA\r\nBlank Alloy Project", "closedSprints": [ { "id": 903, "state": "closed", "name": "2017 Sprint 12 SDK", "startDate": "2017-06-05T00:15:46.290Z", "endDate": "2017-06-19T00:15:00.000Z", "completeDate": "2017-06-19T16:09:22.870Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "420668", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Might be caused by TIMOB-23391, so adding [~vijaysingh] to the flow.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-31T09:11:50.000+0000", "updated": "2017-05-31T09:11:50.000+0000" }, { "id": "420670", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "It's confirmed that the linked ticket caused this regression, reassigning to [~vijaysingh]. More details on the issue:\r\n\r\n*Note 1*:\r\nThe change in TIMOB-23391 was to replace {{boundingWidth}} with {{bounds.size.width}}. As seen in the latest attached screenshot, the {{boundingWidth}} is 260px (the width of the inner view where the label is placed), but {{bounds.size.width}} is 304px (the whole view width). It tried to apply this size to the whole sub-container, resulting in breaking the width-limits of the current line and moving the label to the next line.\r\n\r\n*Note 2*: \r\nIf you let the label auto-size itself by removing the {{width: 100%}}, it works again, although it's obviously no proper solution, more a workaround. \r\n\r\n*Note 3*:\r\nIf we replace {{bounds.size.width}} with {{boundingWidth}} in [this line|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiViewProxy.m#L2723], the test-cases of both tickets work. But until we really understand why, this is no final solution.\r\n\r\nTest-Case:\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar row = Ti.UI.createView({\r\n top: '50%',\r\n borderWidth: 1,\r\n width: '95%',\r\n right: 0,\r\n height: 50,\r\n layout: \"horizontal\"\r\n});\r\n \r\nvar vwCheck = Ti.UI.createView({\r\n borderWidth: 1,\r\n height: Ti.UI.FILL,\r\n width: 44\r\n});\r\n\r\nvar vwLabel = Ti.UI.createView();\r\n \r\nvar lbl = Ti.UI.createLabel({\r\n width: '100%',\r\n borderWidth: 1,\r\n minimumFontSize: 16,\r\n\ttext: 'This is a test label',\r\n left: 0,\r\n font: {\r\n fontSize: '20dp',\r\n }\r\n});\r\n\r\nvwLabel.add(lbl);\r\nrow.add(vwCheck);\r\nrow.add(vwLabel);\r\nwin.add(row);\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-31T11:47:15.000+0000", "updated": "2017-05-31T12:13:17.000+0000" }, { "id": "421151", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In this change following fixes are done -\r\n1. Reverted changes of TIMOB-23391 due to which issue has come (Changes made in TIViewProxy.m)\r\n2. Fixed TIMOB-23391again (changed width calculation function of UILabel , as it was giving wrong width. This change is in TIUILabel.m).\r\nPR (master) - https://github.com/appcelerator/titanium_mobile/pull/9120\r\nBackported PR (6_1_X) - https://github.com/appcelerator/titanium_mobile/pull/9121\r\n\r\nTestCases - \r\n1. As mentioned in this ticket\r\n2. Test cases of TIMOB-23391\r\n\r\n{code:java}\r\nvar stringArray = [\"Gmail Account\", \"Yahoo Account\", \"Skype Account\", \"Linc Account\", \"Appcelerator Account\", \"Microsoft Account\",\"Gmail Account\", \"Yahoo Account\", \"Skype Account\", \"Linc Account\", \"Appcelerator Account\", \"Microsoft Account\"] ;\r\nvar win = Ti.UI.createWindow({\r\n title : 'LabelTest',\r\n backgroundColor : '#fff'\r\n});\r\n\r\nvar wrapperView = Titanium.UI.createView({\r\n height : Ti.UI.SIZE,\r\n width : \"98%\",\r\n layout : 'horizontal',\r\n backgroundColor:'red',\r\n //top : \"0\",\r\n horizontalWrap : true,\r\n});\r\nwin.add(wrapperView);\r\n\r\nfor ( i = 0; i < stringArray.length; i++) {\r\n\r\n var labelView = Titanium.UI.createView({\r\n width : Titanium.UI.SIZE,\r\n height : \"22dp\",\r\n borderRadius : \"11dp\",\r\n backgroundColor : \"#0080B0\",\r\n left : \"6dp\",\r\n bottom:\"5dp\"\r\n });\r\n var label = Titanium.UI.createLabel({\r\n text : stringArray[i],\r\n textAlign : \"left\",\r\n height : \"20dp\",\r\n width : Titanium.UI.SIZE,\r\n wordWrap : false,\r\n ellipsize : false,\r\n font : {\r\n fontSize : \"13dp\"\r\n },\r\n color : \"#FFF\",\r\n });\r\n labelView.add(label);\r\n wrapperView.add(labelView);\r\n}\r\nwin.open();\r\n{code}\r\n\r\n3. Run other layout test cases which have TIUILabel objects.\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-06-07T06:22:06.000+0000", "updated": "2017-06-07T06:22:06.000+0000" }, { "id": "421729", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, view sizes are now calculated correctly when using percentages. Additionally, performed tests related to the following parameters:\r\n\r\n- horizontal / vertical layout\r\n- auto-width (FILL and SIZE) / percentages / static values\r\n- label container that size different than the children / label\r\n- left / right usages\r\n- Portrait / Landscape Orientations\r\n- Tested on Device and Simulator.\r\n\r\nTested On:\r\niPhone 7 10.3.2 Device & Simulator\r\nMac OS Sierra (10.12.5)\r\nTi SDK: 6.1.1.v20170609153006\r\nAppc NPM: 4.2.9\r\nApp CLI: 6.2.2\r\nNode v4.6.0\r\n\r\n*Closing ticket.*", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2017-06-12T13:52:04.000+0000", "updated": "2017-06-12T13:52:04.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }