{ "id": "176306", "key": "TIMOB-28552", "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:12:44.000+0000", "created": "2021-10-12T18:20:25.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "ListView", "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:12:44.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{{ListView}} \"move\" event has the following issues on Android...\r\n* The \"itemIndex\" will return the wrong index if you drag-and-drop the {{ListItem}} slowly. The index changes as the list items shift between the dragged item.\r\n* The \"targetSection\", \"targetSectionIndex\", and \"targetItemIndex\" are undefined. This means we don't know where the {{ListItem}} was moved to in the list.\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. _(This is \"itemIndex\" {{0}}.)_\r\n# Slowly drag it to the bottom of the section and release.\r\n# Notice the log states \"itemIndex\" is {{2}} when it should be {{0}}.\r\n\r\n{code:javascript}\r\nfunction createListViewSection(sectionTitle) {\r\n\tconst items = [];\r\n\tfor (let index = 1; index <= 4; index++) {\r\n\t\titems.push({\r\n\t\t\tproperties: {\r\n\t\t\t\ttitle: `Row ${index}`,\r\n\t\t\t\tcanEdit: false,\r\n\t\t\t\tcanMove: true,\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\tconst section = Ti.UI.createListSection({\r\n\t\theaderTitle: sectionTitle,\r\n\t\titems: items,\r\n\t});\r\n\treturn section;\r\n}\r\n\r\nconst window = Ti.UI.createWindow();\r\nconst listView = Ti.UI.createListView({\r\n\tsections: [\r\n\t\tcreateListViewSection(\"Section 1\"),\r\n\t\tcreateListViewSection(\"Section 2\"),\r\n\t],\r\n\tallowsSelectionDuringEditing: false,\r\n\tallowsMultipleSelectionDuringEditing: false,\r\n\tediting: true,\r\n});\r\nlistView.addEventListener(\"move\", (e) => {\r\n\tconst data = {\r\n\t\tsectionIndex: e.sectionIndex,\r\n\t\titemIndex: e.itemIndex,\r\n\t\ttargetSectionIndex: e.targetSectionIndex,\r\n\t\ttargetItemIndex: e.targetItemIndex,\r\n\t};\r\n\tconsole.log(`@@@ \"move\" event: ${JSON.stringify(data)}`);\r\n});\r\nwindow.add(listView);\r\nwindow.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: ListView \"move\" event can return wrong \"itemIndex\" and is missing \"target*\" properties", "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": "459089", "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:21.000+0000", "updated": "2021-10-14T01:48:21.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }