{ "id": "175212", "key": "TIMOB-27994", "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": "20950", "name": "Release 9.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-07-29T19:27:30.000+0000", "created": "2020-07-01T13:25:45.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "21039", "name": "Release 9.0.3", "archived": false, "released": true, "releaseDate": "2020-06-10" } ], "issuelinks": [ { "id": "59189", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "176052", "key": "TIMOB-28354", "fields": { "summary": "Ti.UI.View Test Suite: Titanium.UI.View Acceptance TIMOB-27994 iOS only", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-02-16T07:37:09.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 using iOS13 or 14 the itemclick event is fired when moving items in a listView instead of a Move event listener.\r\n\r\n*Test Case:*\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : 'white'\r\n});\r\n\r\nvar data = [];\r\nvar listSections = [];\r\nvar fruitsData;\r\nvar vegData;\r\n\r\nvar plainTemplate = {\r\n\tchildTemplates : [{\r\n\t\ttype : 'Ti.UI.Label', // Use a label\r\n\t\tbindId : 'rowtitle', // Bind ID for this label\r\n\t\tproperties : {// Sets the Label.left property\r\n\t\t\tleft : '10dp',\r\n\t\t\t// backgroundColor : 'blue',\r\n\t\t}\r\n\t}, {\r\n\t\ttype : 'Ti.UI.Label', // Use a button\r\n\t\tbindId : 'label', // Bind ID for this button\r\n\t\tproperties : {// Sets several button properties\r\n\t\t\twidth : '80dp',\r\n\t\t\theight : '40dp',\r\n\t\t\tright : '10dp',\r\n\t\t\ttext : 'press me',\r\n\t\t\ttouchEnabled : false\r\n\t\t}\r\n\t}],\r\n};\r\n\r\nfunction report(e) {\r\n\tTi.API.info(e.type);\r\n}\r\n\r\nvar listView = Ti.UI.createListView({\r\n\ttemplates : {\r\n\t\t'plain' : plainTemplate\r\n\t},\r\n\tdefaultItemTemplate : 'plain',\r\n\tediting : true,\r\n\tpruneSectionsOnEdit : true\r\n});\r\n\r\nvar listArray = [{\r\n\tid : \"1001\",\r\n\ttitle : \"Apple\",\r\n\tmoduleId : \"Fruits\"\r\n},{\r\n\tid : \"1002\",\r\n\ttitle : \"carrot\",\r\n\tmoduleId : \"Vegetables\"\r\n}, {\r\n\tid : \"1003\",\r\n\ttitle : \"Banana\",\r\n\tmoduleId : \"Fruits\"\r\n}, {\r\n\tid : \"1004\",\r\n\ttitle : \"Capsicum\",\r\n\tmoduleId : \"Vegetables\"\r\n}, {\r\n\tid : \"1005\",\r\n\ttitle : \"Brinjal\",\r\n\tmoduleId : \"Vegetables\"\r\n}, {\r\n\tid : \"1006\",\r\n\ttitle : \"Papaya\",\r\n\tmoduleId : \"Fruits\"\r\n}, {\r\n\tid : \"1007\",\r\n\ttitle : \"PineApple\",\r\n\tmoduleId : \"Fruits\"\r\n}, {\r\n\tid : \"1008\",\r\n\ttitle : \"LadiesFinger\",\r\n\tmoduleId : \"Vegetables\"\r\n}\r\n];\r\n\r\nfunction getIndex(array, itemId){\r\n\tvar actualIndex;\r\n\tarray.findIndex(function(arrayObj,index){\r\n\t\tif(arrayObj.id.toString() === itemId.toString()){\r\n\t\t\tactualIndex = index;\r\n\t\t}\r\n\t});\r\n\treturn actualIndex;\r\n}\r\n\r\nvar sourceItemId;\r\nvar targetItemId;\r\nvar insertBefore = false;\r\n\r\nlistView.addEventListener('itemclick', function(e){\r\n\talert('Item click fired::::::::');\r\n});\r\n\r\nlistView.addEventListener('move', function(e) {\r\n\tTi.API.info('Move event listener::::::::' + JSON.stringify(e));\r\n\tTi.API.info('e.itemId:::::' + JSON.stringify(e.itemId));\r\n\tsourceItemId = e.itemId;\r\n});\r\n\r\nfunction setModuleItems(moduleData){\r\n\tvar listItems = [];\r\n\tmoduleData.forEach(function(listArrayItem){\r\n\t\tlistItems.push({\r\n\t\trowtitle : {\r\n\t\t\ttext : listArrayItem.title\r\n\t\t},\r\n\t\tlabel :{\r\n\t\t\ttext : \"Press Me\"\r\n\t\t},\r\n\t\tproperties : {\r\n\t\t\titemId : listArrayItem.id,\r\n\t\t\tcanEdit : true,\r\n\t\t\tcanMove : true\r\n\t\t}\r\n\t});\r\n\t});\r\n\treturn listItems;\r\n}\r\n\r\nif(listArray.length > 0){\r\n\tfruitsData = listArray.filter(listArrayObj => listArrayObj.moduleId === \"Fruits\");\r\n\tvegData = listArray.filter(listArrayObj => listArrayObj.moduleId === \"Vegetables\");\r\n\r\n\tif(fruitsData.length !== 0){\r\n\t\tvar fruitsSection = Ti.UI.createListSection({\r\n\t\t\theaderTitle :\"Fruits\"\r\n\t\t});\r\n\t\tlistSections.push(fruitsSection);\r\n\t\tfruitsSection.setItems(setModuleItems(fruitsData));\r\n\t}\r\n\tif(vegData.length !== 0){\r\n\t\tvar vegSection = Ti.UI.createListSection({\r\n\t\t\theaderTitle :\"Vegetables\"\r\n\t\t});\r\n\t\tlistSections.push(vegSection);\r\n\t\tvegSection.setItems(setModuleItems(vegData));\r\n\t}\r\n}\r\nlistView.sections = listSections;\r\nwin.add(listView);\r\nwin.open(); \r\n{code}\r\n\r\n*Test Steps*\r\n# Create a Titanium application \r\n# Copy the code above into the {{app.js}}\r\n# Run the app on a iOS 13/14 device\r\n# Move one of the items in the listView around\r\n# Notice a click event is fired \r\n# Rerun application on a device/sim < iOS13\r\n# Move one of the items in the listView around\r\n# Notice Move event listener is fired and logged \r\n\r\n*Expected result*\r\nFollowing should be logged:\r\n{code:java}\r\n[INFO] Move event listener::::::::{\"itemId\":\"1001\",\"itemIndex\":0,\"targetItemIndex\":3,\"section\":{},\"targetSectionIndex\":0,\"sectionIndex\":0,\"targetSection\":{},\"bubbles\":false,\"type\":\"move\",\"source\":{\"canScroll\":true,\"caseInsensitiveSearch\":true,\"horizontalWrap\":true,\"visible\":true,\"touchEnabled\":true,\"dictTemplates\":{\"plain\":{}},\"defaultItemTemplate\":\"plain\",\"editing\":true,\"pruneSectionsOnEdit\":true},\"cancelBubble\":false}\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: itemclick event its firing instead of a move event when ordering items in a list (iOS 13+)", "creator": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "MacOS Big Sur: 11.0 Beta\r\nXcode: 12.0 Beta \r\nJava Version: 1.8.0_242\r\nAndroid NDK: 21.3.6528147\r\nNode.js: 12.18.1\r\n\"\"NPM\":\"5.0.0\",\"CLI\":\"8.0.0\"\"\r\niphone 8 Sim (14.0 Beta)\r\niphone 8 Sim (13.0)\r\nPhone 8 sim (10.3)", "comment": { "comments": [ { "id": "455994", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "1. In my test behavior is as below -\r\n a) For iOS < 13 only 'move' event is fired. \r\n b) For iOS 13+ 'move' event as well as 'itemclick' event is fired.\r\n\r\n2. While debugging I can see that in native iOS 13+\r\n{code:java}\r\n- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath\r\n{code}\r\n delegate method is also called, which is invoking 'itemclick' event. In iOS < 13, it is not called.\r\n\r\n\r\n+Solution/Workaround -+\r\n In this case (for iOS 13+), ['itemclick'|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView-event-itemclick] has property 'accessoryClicked' set to 'true'. \r\nSo apply a condition in your code with help of property 'accessoryClicked'.\r\ne.g. Modify 'itemclick' event listener as below -\r\n\r\n{code:java}\r\nlistView.addEventListener('itemclick', function(e){\r\n\tif (listView.editing == true && e.accessoryClicked == true) {\r\n\t\tTi.API.info('Ignore itemclick event. It is fired while moving rows');\r\n\t} else {\r\n\t\talert('Item click fired::::::::');\r\n\t}\r\n});\r\n{code}\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-02T20:01:27.000+0000", "updated": "2020-07-02T22:30:49.000+0000" }, { "id": "456008", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR - https://github.com/appcelerator/titanium_mobile/pull/11805", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-06T20:31:10.000+0000", "updated": "2020-07-06T20:31:10.000+0000" }, { "id": "456027", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-08T22:07:16.000+0000", "updated": "2020-07-08T22:07:16.000+0000" }, { "id": "456270", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on:\r\nMac OS: 10.15.4\r\nSDK: 9.1.0.v20200727104531\r\nAppc CLI: 8.1.0-master.7\r\nJDK: 11.0.4\r\nNode: 10.17.0\r\nStudio: 6.0.0.202005141803\r\nXcode: 12.0 beta\r\nDevice: iOS simulator 14.0 beta, 13.5, 12.2, 11.4", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-29T19:27:30.000+0000", "updated": "2020-07-29T19:27:30.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }