{ "id": "123261", "key": "TIMOB-15913", "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": [], "resolution": null, "resolutiondate": null, "created": "2013-12-05T02:19:20.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "defect", "reprod" ], "versions": [ { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:57.000+0000", "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" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nWhen an instance of Ti.UI.Switch exists in Ti.UI.TableViewRows with a className attribute set and enough rows are present in the table that they scroll all the way off the screen, some of the switches will fire 'change' events as they scroll on and off the screen.\r\n\r\nh4. Steps to reproduce\r\n# Create a new mobile project\r\n# paste this code into app.js\r\n{code}\r\nvar window = Ti.UI.createWindow({\r\n backgroundColor: '#FFF'\r\n});\r\nvar tableView = Ti.UI.createTableView();\r\nvar data = [];\r\n\r\nfor (var i=0; i<50; i++) {\r\n var row = Ti.UI.createTableViewRow({\r\n height: 100,\r\n className: 'myRow'\r\n });\r\n var mySwitch = Ti.UI.createSwitch({\r\n value: i % 3 == 0,\r\n number: i\r\n });\r\n mySwitch.addEventListener('change', function(e) {\r\n alert(\"Switch \" + e.source.number + \" was changed!\");\r\n });\r\n row.add(Ti.UI.createLabel({\r\n text: i,\r\n left: 20,\r\n color: '#000'\r\n }));\r\n row.add(mySwitch);\r\n data.push(row);\r\n}\r\n\r\ntableView.setData(data);\r\nwindow.add(tableView);\r\nwindow.open();\r\n{code}\r\n# run this in device\r\n# just scroll down", "attachment": [], "flagged": false, "summary": "Android: Ti.UI.Switch in TableViewRow with className fires change event when scrolled onto screen", "creator": { "name": "robbjl", "key": "robbjl", "displayName": "Jason Robb", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "robbjl", "key": "robbjl", "displayName": "Jason Robb", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 3.1.3\r\nAndroid Nexus 4 - Android OS 4.4", "comment": { "comments": [ { "id": "422961", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue with the following environment;\r\nPixel (7.1)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1.v20170623141152\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.1\r\nTi CLI 5.0.13\r\nAlloy 1.9.11\r\nArrow 2.0.0\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-27T18:16:58.000+0000", "updated": "2017-06-27T18:16:58.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }