{ "id": "171848", "key": "TIMOB-26160", "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": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-08-24T17:25:23.000+0000", "created": "2018-06-27T07:27:04.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "alloy", "ios", "run-on-main-thread", "scrollableView" ], "versions": [ { "id": "20102", "name": "Release 7.1.1", "archived": false, "released": true, "releaseDate": "2018-05-02" }, { "id": "20099", "name": "Release 7.2.0", "archived": false, "released": true, "releaseDate": "2018-06-14" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-09-10T10:20:36.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": "When enabling {code:java}true{code} ScrollableView does not render views when re-adding views to the ScrollableView until you scroll a bit then they suddenly render.\r\n\r\nWhen removing `run-on-main-thread` it works just fine.\r\n\r\nSteps to reproduce:\r\n1. Create new alloy project\r\n2. In your index.js add the code below\r\n3. Build to ios simlulator\r\n4. Scroll to see everything is working \r\n5. Click on re-add views button - See that views are now all white / not rendered\r\n6. Scroll left or right and see that the views then render\r\n7. Remove run-on-main-thread from tiapp.xml and build and see that everything works fine.\r\n\r\n{code:java}\r\nfunction reAddViews(){\r\n\toldViews = scrollableView.views;\r\n\tscrollableView.views = oldViews;\r\n\r\n\t// ANOTHER TEST TO PROVE ONLY NEWLY CREATED VIEWS WORK\r\n\t//var view3 = Ti.UI.createView({ backgroundColor:'orange'});\r\n\t//scrollableView.views = [oldViews[0],oldViews[1],view3,oldViews[3],oldViews[4]]\r\n\r\n\tscrollableView.currentPage = 2;\r\n}\r\n\r\nvar button = Titanium.UI.createButton({\r\n title: 'Re-Add Views',\r\n bottom: 10,\r\n height: 50,\r\n});\r\nbutton.addEventListener('click',reAddViews);\r\n$.index.add(button);\r\n\r\nvar view1 = Ti.UI.createView({ backgroundColor:'red'});\r\nvar view2 = Ti.UI.createView({ backgroundColor:'blue'});\r\nvar view3 = Ti.UI.createView({ backgroundColor:'yellow'});\r\nvar view4 = Ti.UI.createView({ backgroundColor:'green'});\r\nvar view5 = Ti.UI.createView({ backgroundColor:'pink'});\r\n\r\nvar scrollableView = Ti.UI.createScrollableView({\r\n views:[view1,view2,view3,view4,view5],\r\n showPagingControl:true,\r\n bottom: 50,\r\n currentPage:2,\r\n cacheSize: 9,\r\n});\r\n\r\n$.index.add(scrollableView);\r\n$.index.open();\r\n{code}\r\n", "attachment": [ { "id": "65300", "filename": "bug.mov", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-27T07:39:24.000+0000", "size": 905366, "mimeType": "video/quicktime" } ], "flagged": false, "summary": "iOS: ScrollableView + run-on-main-thread - views dont render until scroll when re-adding views", "creator": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\nName = Mac OS X\r\nVersion = 10.13.2\r\nArchitecture = 64bit\r\n\r\nCPUs = 8\r\nMemory = 17179869184\r\nNode.js\r\nNode.js Version = 8.1.2\r\nnpm Version = 3.10.10\r\nTitanium CLI\r\nCLI Version = 5.1.0\r\nTitanium SDK\r\nSDK Version = 7.2.0.GA\r\nSDK Path = /Users/user/Library/Application Support/Titanium/mobilesdk/osx/7.2.0.GA\r\nTarget Platform = iphone", "closedSprints": [ { "id": 1065, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2018-08-13T17:39:36.846Z", "endDate": "2018-08-27T17:39:00.000Z", "completeDate": "2018-08-29T16:10:57.013Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "438750", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Looks like a valid bug! We are scheduling it for the next release (7.4.0, since 7.3.0 will go RC already soon).\r\n\r\nSandboxes test-case:\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nfunction reAddViews() {\r\n oldViews = scrollableView.views;\r\n scrollableView.views = oldViews;\r\n\r\n // ANOTHER TEST TO PROVE ONLY NEWLY CREATED VIEWS WORK\r\n //var view3 = Ti.UI.createView({ backgroundColor:'orange'});\r\n //scrollableView.views = [oldViews[0],oldViews[1],view3,oldViews[3],oldViews[4]]\r\n\r\n scrollableView.currentPage = 2;\r\n}\r\n\r\nvar button = Titanium.UI.createButton({\r\n title: 'Re-Add Views',\r\n bottom: 10,\r\n height: 50,\r\n});\r\nbutton.addEventListener('click', reAddViews);\r\nwin.add(button);\r\n\r\nvar view1 = Ti.UI.createView({\r\n backgroundColor: 'red'\r\n});\r\nvar view2 = Ti.UI.createView({\r\n backgroundColor: 'blue'\r\n});\r\nvar view3 = Ti.UI.createView({\r\n backgroundColor: 'yellow'\r\n});\r\nvar view4 = Ti.UI.createView({\r\n backgroundColor: 'green'\r\n});\r\nvar view5 = Ti.UI.createView({\r\n backgroundColor: 'pink'\r\n});\r\n\r\nvar scrollableView = Ti.UI.createScrollableView({\r\n views: [view1, view2, view3, view4, view5],\r\n showPagingControl: true,\r\n bottom: 50,\r\n currentPage: 2,\r\n cacheSize: 9,\r\n});\r\n\r\nwin.add(scrollableView);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-27T08:56:54.000+0000", "updated": "2018-06-27T08:59:40.000+0000" }, { "id": "438751", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "ok once there is a fix I can add it to my sdk as its already a mess with other cherry picks to handle other bugs", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-27T09:01:29.000+0000", "updated": "2018-06-27T09:01:29.000+0000" }, { "id": "438752", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/10135", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-27T09:11:53.000+0000", "updated": "2018-06-27T09:11:53.000+0000" }, { "id": "438755", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~dieskim] We just provided a pull request and the change was integrated into master. Thanks for reporting this, also thanks for the good test-case!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-27T09:41:35.000+0000", "updated": "2018-06-27T09:41:35.000+0000" }, { "id": "438762", "author": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "just tested the fix on my app - so far so good, ill let you know if something else pops up but its looking good so far", "updateAuthor": { "name": "dieskim", "key": "dieskim", "displayName": "David van de Meer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-27T14:04:54.000+0000", "updated": "2018-06-27T14:04:54.000+0000" }, { "id": "440888", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Verified fix in SDK version: {{7.4.0.v20180817092850}}. Application now renders views when they are being re-added. \r\n\r\n*FR Passed (Test Steps):*\r\n\r\n# Created a titanium application with the test case above\r\n# Ran the program\r\n# Scrolled left and right to confirm views were visible \r\n# Pressed the {{re-add views button}}\r\n# Able to see views were able to render without scrolling left or right \r\n\r\n*Test Environment*\r\n\r\n{code:java}\r\nAPPC Studio: 5.1.0.201808080937\r\nAPPC CLI: 7.0.5\r\niphone 6 simulator (11.2)\r\nOperating System Name: Mac OS High Sierra\r\nOperating System Version: 10.13\r\nNode.js Version: 8.9.1\r\nXcode 9.2{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-20T10:45:20.000+0000", "updated": "2018-08-20T10:45:20.000+0000" }, { "id": "441436", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Also verified using SDK Version {{7.5.0.v20180906093938}}\r\n\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-10T10:20:28.000+0000", "updated": "2018-09-10T10:20:28.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }