{ "id": "123037", "key": "TIMOB-15848", "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": "15719", "description": "2013 Sprint 26", "name": "2013 Sprint 26", "archived": true, "released": true, "releaseDate": "2014-01-03" }, { "id": "15720", "description": "2013 Sprint 26 API", "name": "2013 Sprint 26 API", "archived": true, "released": true, "releaseDate": "2014-01-03" }, { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-01-02T21:31:05.000+0000", "created": "2013-11-28T11:45:36.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ListViews", "module_listview", "qe-testadded", "supportTeam" ], "versions": [ { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:44:41.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 we use scrollToItem with animation:false in a listView,clear listView doesn't work properly.\r\nHowever, if use scrollToItem with 'animation:true', everything works fine.\r\n\r\n*Steps To Reproduce* : \r\n\r\n1. Create a new titanium classic project.\r\n\r\n2. Copy and paste the below code in app.js :\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : 'white'\r\n});\r\nvar view = Ti.UI.createView({});\r\nvar btn = Ti.UI.createButton({\r\n\ttop : 20,\r\n\tbackgroundColor : 'red',\r\n\twidth : 100,\r\n\ttitle : 'Clear'\r\n});\r\n\r\nview.add(btn);\r\nwin.add(view);\r\nvar myTemplate = {\r\n\tchildTemplates : [{\r\n\t\ttype : 'Ti.UI.Label',\r\n\t\tbindId : 'one',\r\n\t\tproperties : {\r\n\t\t\tcolor : 'black',\r\n\t\t\tfont : {\r\n\t\t\t\tfontFamily : 'Arial',\r\n\t\t\t\tfontSize : '14dp'\r\n\t\t\t},\r\n\t\t\tleft : '10dp'\r\n\t\t}\r\n\t}, {\r\n\t\ttype : 'Ti.UI.Label',\r\n\t\tbindId : 'two',\r\n\t\tproperties : {\r\n\t\t\tcolor : 'black',\r\n\t\t\tfont : {\r\n\t\t\t\tfontFamily : 'Arial',\r\n\t\t\t\tfontSize : '14dp'\r\n\t\t\t},\r\n\t\t\tleft : '50dp'\r\n\t\t}\r\n\t}, {\r\n\t\ttype : 'Ti.UI.Label',\r\n\t\tbindId : 'three',\r\n\t\tproperties : {\r\n\t\t\tcolor : 'gray',\r\n\t\t\tfont : {\r\n\t\t\t\tfontFamily : 'Arial',\r\n\t\t\t\tfontSize : '14dp'\r\n\t\t\t},\r\n\t\t\tleft : '90dp'\r\n\t\t}\r\n\t}, {\r\n\t\ttype : 'Ti.UI.Label',\r\n\t\tbindId : 'four',\r\n\t\tproperties : {\r\n\t\t\tcolor : 'gray',\r\n\t\t\tfont : {\r\n\t\t\t\tfontFamily : 'Arial',\r\n\t\t\t\tfontSize : '14dp'\r\n\t\t\t},\r\n\t\t\tleft : '130dp'\r\n\t\t}\r\n\t}, {\r\n\t\ttype : 'Ti.UI.Label',\r\n\t\tbindId : 'five',\r\n\t\tproperties : {\r\n\t\t\tcolor : 'gray',\r\n\t\t\tfont : {\r\n\t\t\t\tfontFamily : 'Arial',\r\n\t\t\t\tfontSize : '14dp'\r\n\t\t\t},\r\n\t\t\tleft : '170dp'\r\n\t\t}\r\n\t}, {\r\n\t\ttype : 'Ti.UI.Label',\r\n\t\tbindId : 'six',\r\n\t\tproperties : {\r\n\t\t\tcolor : 'gray',\r\n\t\t\tfont : {\r\n\t\t\t\tfontFamily : 'Arial',\r\n\t\t\t\tfontSize : '14dp'\r\n\t\t\t},\r\n\t\t\tleft : '210dp'\r\n\t\t}\r\n\t}, {\r\n\t\ttype : 'Ti.UI.Label',\r\n\t\tbindId : 'seven',\r\n\t\tproperties : {\r\n\t\t\tcolor : 'gray',\r\n\t\t\tfont : {\r\n\t\t\t\tfontFamily : 'Arial',\r\n\t\t\t\tfontSize : '14dp'\r\n\t\t\t},\r\n\t\t\tleft : '240dp'\r\n\t\t}\r\n\t}]\r\n};\r\n\r\nvar genData = function(section) {\r\n\tvar data = [];\r\n\tfor ( i = 0; i < 20; i++) {\r\n\t\tdata.push({\r\n\t\t\tone : {\r\n\t\t\t\ttext : section + ' one'\r\n\t\t\t},\r\n\t\t\ttwo : {\r\n\t\t\t\ttext : 'two'\r\n\t\t\t},\r\n\t\t\tthree : {\r\n\t\t\t\ttext : 'three'\r\n\t\t\t},\r\n\t\t\tfour : {\r\n\t\t\t\ttext : 'four'\r\n\t\t\t},\r\n\t\t\tfive : {\r\n\t\t\t\ttext : 'five'\r\n\t\t\t},\r\n\t\t\tsix : {\r\n\t\t\t\ttext : 'six'\r\n\t\t\t},\r\n\t\t\tseven : {\r\n\t\t\t\ttext : 'seven'\r\n\t\t\t},\r\n\t\t\ttemplate : 'template'\r\n\t\t});\r\n\t}\r\n\r\n\treturn data;\r\n};\r\n\r\nvar genSections = function() {\r\n\tvar sections = [];\r\n\tfor ( j = 0; j < 10; j++) {\r\n\t\tvar section = Ti.UI.createListSection({\r\n\t\t\theaderTitle : 'Section ' + j\r\n\t\t});\r\n\t\tsection.setItems(genData(j));\r\n\t\tsections.push(section);\r\n\t}\r\n\r\n\treturn sections;\r\n};\r\nvar listView = Ti.UI.createListView({\r\n\ttop : 100\r\n});\r\nfunction populateEventsList() {\r\n\r\n\tlistView.templates = {\r\n\t\t'template' : myTemplate\r\n\t};\r\n\tlistView.setSections(genSections());\r\n\r\n}\r\n\r\nbtn.addEventListener('click', function() {\r\n\r\n\tvar length = listView.sections.length;\r\n\tif (length === 0) {\r\n\t\tpopulateEventsList();\r\n\t\tbtn.title = 'Clear';\r\n\t\tlistView.scrollToItem(5, 3, {\r\n\t\t\tanimated : false,\r\n\r\n\t\t});\r\n\t} else {\r\n\t\tlistView.setSections([]);\r\n\t\tbtn.title = 'Populate';\r\n\t}\r\n\r\n});\r\n\r\npopulateEventsList();\r\nwin.add(listView);\r\nwin.open();\r\n{code} \r\n\r\n2. Launch the application in iOS7 simulator/device.\r\n\r\n3. Click on 'Clear' button and you will see everything clears perfectly fine.\r\n\r\n4. Click on 'Populate' button and you will see everything populates as expected.\r\n\r\n5. Now again click on 'Clear' button, you will see listView doesn't cleared properly.", "attachment": [], "flagged": false, "summary": "iOS: Clearing listView doesn't work properly when use with scrollToItem(i,i,animation:false)", "creator": { "name": "mpathak", "key": "mpathak", "displayName": "Meenakshi Pathak", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mpathak", "key": "mpathak", "displayName": "Meenakshi Pathak", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 7\r\nTiSDK 3.1.3.GA, 3.2.0.v20131105162443.21b6737", "comment": { "comments": [ { "id": "281783", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can you please confirm this also happens against SDK 3.2.0?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-28T14:16:23.000+0000", "updated": "2013-11-28T14:16:23.000+0000" }, { "id": "281895", "author": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested on 3.2.0.v20131105162443.21b6737, the issue is still occurring. \nTo clarify, the list view does not clear as the first section header is still displayed.", "updateAuthor": { "name": "btran", "key": "btran", "displayName": "Betty Tran", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-02T15:50:45.000+0000", "updated": "2013-12-02T15:50:45.000+0000" }, { "id": "286534", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "fixed by https://github.com/appcelerator/titanium_mobile/pull/5156", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-02T21:31:31.000+0000", "updated": "2014-01-02T21:31:31.000+0000" }, { "id": "286601", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport to 3_2_X\nhttps://github.com/appcelerator/titanium_mobile/pull/5181", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-03T18:18:30.000+0000", "updated": "2014-01-03T18:18:30.000+0000" }, { "id": "286924", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Tested with above testapp, listview is getting cleared every time after populating the list\n\nVerified fix on:\nDevice : iPhone 5s , iOS version : 7.0.2\nSDK: 3.3.0.v20140106195650\nSDK: 3.2.1.v20140106195644\nCLI version : 3.2.0\nOS : MAC OSX 10.9\nAlloy: 1.3.1-beta\nACS: 1.0.11\nnpm:1.3.2\nAppcelerator Studio, build: 3.2.1.201401061716\ntitanium-code-processor: 1.1.0\nXCode : 5.0.2", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-01-07T09:20:52.000+0000", "updated": "2014-01-07T09:20:52.000+0000" }, { "id": "287078", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. Verified the ListView gets cleared properly after populating it with rows.\n\nTested on:\n\nAppcelerator Studio, build: 3.2.1.201401061716\nSDK build: 3.2.1.v20140106195644, 3.3.0.v20140106195650\nCLI: 3.2.0\nAlloy: 1.3.1-beta\nXcode: 5.0.2\nDevices: iphone 4s (6.0.1), iphone 5s (7.0.2), iphone simulator 4-inch retina (6.1), iphone simulator 4-inch retina (7.0.3)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-07T22:41:01.000+0000", "updated": "2014-01-07T22:41:01.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }