{ "id": "86449", "key": "AC-2822", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-02-23T12:11:27.000+0000", "created": "2012-02-14T05:21:49.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:47:45.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "h3. The problem\r\n\r\n\r\nIn this KitchenSink example: https://github.com/appcelerator/KitchenSink/blob/master/Resources/examples/view_with_size.js\r\n\r\n\"size\" property is used to define and manipulate view dimension values:\r\n\r\n{code}\r\nvar view = Ti.UI.createView({\r\n\tsize:{\r\n\t\twidth:100,\r\n\t\theight:100\r\n\t},\r\n\tbackgroundColor:\"red\"\r\n});\r\n\r\nbutton.addEventListener('click',function() {\r\n view.size = {width:150,height:150};\r\n label.text = \"Box should now be 150x150\";\r\n});\r\n{code}\r\n\r\n\r\nh3. Expected behavior\r\n\r\n\r\nSince \"size\" object's properties \"width\" and \"height\" reflect rendered view's dimension values, behavior from KitchenSink example is unintuitive and confusing. In my opinion that behavior should be removed (from KitchenSink and from SDK).\r\n\r\nOnly valid use case should be this:\r\n\r\n{code}\r\nvar view = Ti.UI.createView({ height: '50%', width: 'auto' });\r\n\r\n...\r\n\r\nview.height // 50%\r\nview.width // 'auto'\r\nview.size.height // 200 (for example), readonly\r\nview.size.width // 42 (for example), readonly\r\n{code}", "attachment": [], "flagged": false, "summary": "View \"size\" property shouldn't be used for dimension values manipulation", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* Titanium SDK version: 1.9.0 (02/13/12 17:46 16e6b6d)\r\n* v8\r\n* Android 3.1\r\n* Thinkpad Tablet\r\n* Windows XP", "comment": { "comments": [ { "id": "183013", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "From documentation: \"The size property is a read-only dictionary with two properties, width and height.\"\r\n\r\n\r\nhttps://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.View-object", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-02-14T05:27:44.000+0000", "updated": "2012-02-14T05:27:44.000+0000" }, { "id": "184085", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "As commented, already documented. Not a bug. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2012-02-23T12:11:27.000+0000", "updated": "2012-02-23T12:11:27.000+0000" }, { "id": "184141", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I don't understand. This should be a bug, I commented that \"size\" property is read-only (from documentation), while in KitchenSink example there is a code that writes to that property: \"view.size = {width:150,height:150};\"", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-02-24T00:14:26.000+0000", "updated": "2012-02-24T00:14:26.000+0000" }, { "id": "280974", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Invalid issue. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-24T22:18:27.000+0000", "updated": "2013-11-24T22:18:27.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }