{ "id": "166151", "key": "AC-4804", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-02-20T19:26:59.000+0000", "created": "2017-02-19T17:08:30.000+0000", "labels": [ "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-02-20T19:26:59.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "If I add a \"click\" event to a TableViewRow with a Ti.UI.Switch, the event does not fire if the row is pressed.\r\nThis behaviour affects only Android O.S , if you try to run the code below on iOS you will not see this bug.\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar rowWithSwitch = Ti.UI.createTableViewRow({height:100});\r\nvar uiSwitch = Ti.UI.createSwitch();\r\n\r\nrowWithSwitch.add(uiSwitch);\r\n// the alert does not appear if you press the row\r\nrowWithSwitch.addEventListener(\"click\",function(){ alert(\" Row clicked \");});\r\n\r\n\r\nvar rowWithoutSwitch = Ti.UI.createTableViewRow({height:100});\r\n// the alert appears correctly\r\nrowWithoutSwitch.addEventListener(\"click\",function(){ alert(\" Row clicked \");});\r\n\r\n\r\nvar tableView = Ti.UI.createTableView({\r\n\tdata: [rowWithSwitch,rowWithoutSwitch]\r\n});\r\n\r\nwin.add(tableView);\r\n\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "\"click\" events on TableViewRow do not fire on TableViewRow with Ti.UI.Switch", "creator": { "name": "grazianogrespan", "key": "grazianogrespan", "displayName": "grazianogrespan", "active": true, "timeZone": "Europe/Rome" }, "subtasks": [], "reporter": { "name": "grazianogrespan", "key": "grazianogrespan", "displayName": "grazianogrespan", "active": true, "timeZone": "Europe/Rome" }, "environment": "O.S : macOS Sierra\r\nTi SDK: 6.0.1.GA\r\nAndroid Emulator O.S 6.0", "comment": { "comments": [ { "id": "407409", "author": { "name": "grazianogrespan", "key": "grazianogrespan", "displayName": "grazianogrespan", "active": true, "timeZone": "Europe/Rome" }, "body": "I have just found that if I put \"focusable\" property to \"false\" on Ti.UI.Switch click events fire correctly. \r\nI don't know if this is an hack or the right purpose of focusable property. Anyway, maybe, it should be written on the doc.", "updateAuthor": { "name": "grazianogrespan", "key": "grazianogrespan", "displayName": "grazianogrespan", "active": true, "timeZone": "Europe/Rome" }, "created": "2017-02-19T17:37:54.000+0000", "updated": "2017-02-19T17:37:54.000+0000" }, { "id": "407445", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, It's documented. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Switch-property-focusable \" Whether view should be focusable while navigating with the trackball.\". Since you are adding switch in tableviewrow and you are adding eventlistener in row you should add this to work both. And specifically for Android. You can turn off the listener for row by setting this false and work only with switch. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-02-20T19:26:38.000+0000", "updated": "2017-02-20T19:26:38.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }