{ "id": "176309", "key": "TIMOB-28554", "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": "21249", "name": "Release 10.2.0", "archived": false, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-10-20T03:13:05.000+0000", "created": "2021-10-14T00:59:16.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "TableView", "android", "editing", "move", "parity" ], "versions": [ { "id": "21052", "description": "", "name": "Release 9.3.0", "archived": false, "released": true, "releaseDate": "2020-12-14" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-10-20T03:13:05.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\n{{TableView}} \"move\" event properties \"row\" and \"index\" return the wrong values when dragging it. These properties should return the row that's being dragged, but instead returns the last row that was dragged over.\r\n\r\n*Steps to reproduce:*\r\n# Build and run the below on Android.\r\n# Tap and hold the top most row. (Named \"Row 1\".)\r\n# Drag and drop it all the way to the bottom of the TableView in Section 2.\r\n# Observe the log and notice it returns the wrong row name and index.\r\n\r\n{code:javascript}\r\nfunction createTableViewSection(sectionTitle) {\r\n\tconst section = Ti.UI.createTableViewSection({ headerTitle: sectionTitle });\r\n\tsection.add(Ti.UI.createTableViewRow({ title: \"Row 1\", editable: false, moveable: true }));\r\n\tsection.add(Ti.UI.createTableViewRow({ title: \"Row 2\", editable: false, moveable: true }));\r\n\tsection.add(Ti.UI.createTableViewRow({ title: \"Row 3\", editable: false, moveable: true }));\r\n\tsection.add(Ti.UI.createTableViewRow({ title: \"Row 4\", editable: false, moveable: true }));\r\n\treturn section;\r\n}\r\n\r\nconst window = Ti.UI.createWindow();\r\nconst tableView = Ti.UI.createTableView({\r\n\tdata: [\r\n\t\tcreateTableViewSection(\"Section 1\"),\r\n\t\tcreateTableViewSection(\"Section 2\"),\r\n\t],\r\n\tallowsSelectionDuringEditing: false,\r\n\tallowsMultipleSelectionDuringEditing: false,\r\n\tediting: true,\r\n});\r\ntableView.addEventListener(\"move\", (e) => {\r\n\tconst data = {\r\n\t\tsectionTitle: e.section.headerTitle,\r\n\t\trowTitle: e.row.title,\r\n\t\tindex: e.index,\r\n\t};\r\n\tconsole.log(`@@@ \"move\" event: ${JSON.stringify(data)}`);\r\n});\r\nwindow.add(tableView);\r\nwindow.open();\r\n{code}\r\n\r\n*Result:*\r\nThe above \"Steps to reproduce\" logs the following. This is wrong since you dragged \"Row 1\", not \"Row 4\". Also, \"index\" should be {{7}} which is the last position in the TableView, not {{6}} which is the 2nd to last position. The issue is the event always contains info if the last row dragged over.\r\n{code:javascript}\r\n @@@ \"move\" event: {\"sectionTitle\":\"Section 2\",\"rowTitle\":\"Row 4\",\"index\":6}\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: TableView \"move\" event returns wrong \"row\" and \"index\"", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "459091", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/13120", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-14T01:48:52.000+0000", "updated": "2021-10-14T01:48:52.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }