{ "id": "63929", "key": "TIMOB-3297", "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": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-08-28T23:00:53.000+0000", "created": "2011-04-15T03:41:39.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "parity", "supportTeam" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "14728", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "85354", "key": "TIDOC-251", "fields": { "summary": "APIDoc: iOS UI.Switch - click event not currently supported. Possibly others", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-20T21:26:10.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": "{html}

Environment: iOS 4.2, Ti SDK 1.6, Mac OS

\r\n

In the above environment, the switch click event does not fire.\r\nThe following code demonstrates the issue. The same code works fine\r\non Android.

\r\n
\r\nTi.UI.setBackgroundColor('#226');\r\n \r\nvar win1 = Ti.UI.createWindow({  \r\n    title:'this is window1',\r\n    backgroundColor:'#fff'\r\n});\r\n \r\nvar switch1 = Ti.UI.createSwitch({\r\n    value:false,\r\n    top:30\r\n});\r\n \r\nswitch1.addEventListener('click', function(e) {\r\n    Ti.API.info('the switch has been switched to: '+e.source.value);\r\n});\r\n \r\nwin1.add(switch1);\r\nwin1.open();\r\n
{html}", "attachment": [], "flagged": false, "summary": "iOS: Ti.UI.Switch click event does not fire", "creator": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": "Titanium SDK: 3.2.0.GA\r\nTitanium CLI: 3.2.0 \r\nIOS Simulator 7.0.3 ", "comment": { "comments": [ { "id": "189964", "author": { "name": "fspencer", "key": "fspencer", "displayName": "Fred Spencer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Though it's understood on iOS that this is possibly working as intended, the issue is parity.", "updateAuthor": { "name": "fspencer", "key": "fspencer", "displayName": "Fred Spencer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-05T09:21:48.000+0000", "updated": "2012-04-05T09:21:48.000+0000" }, { "id": "217726", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested on a Samsung Galaxy S2 and the iOS simulator using TiSDK 2.2.0v20120904101713, issue still valid. \r\n\r\n{code}\r\nTi.UI.setBackgroundColor('#226');\r\n \r\nvar win1 = Ti.UI.createWindow({ \r\n title:'this is window1',\r\n backgroundColor:'#fff'\r\n});\r\n \r\nvar switch1 = Ti.UI.createSwitch({\r\n value:false,\r\n top:30\r\n});\r\n \r\nswitch1.addEventListener('click', function(e) {\r\n alert('the switch has been switched to: '+e.source.value);\r\n});\r\n \r\nwin1.add(switch1);\r\nwin1.open();\r\n{code}", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-09-05T16:27:55.000+0000", "updated": "2012-09-05T16:27:55.000+0000" }, { "id": "250740", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces \n\nTested with\n\nTitanium Studio, build: 3.0.1.201212181159\nTitanium SDK version: 3.1.0 \niOS iPhone Simulator: iOS SDK version: 6.0", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-08T05:22:48.000+0000", "updated": "2013-05-08T05:22:48.000+0000" }, { "id": "394586", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This issue is invalid. Switch-controls are not supposed to fire click-events for changed values. As the [docs say|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Switch-event-change], the {{change}} event is supposed to handle the changed values.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-28T23:00:53.000+0000", "updated": "2016-08-28T23:00:53.000+0000" }, { "id": "394655", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel] Could we hide the click event in the docs? If it doesn't do anything, should it be documented?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-08-29T18:03:46.000+0000", "updated": "2016-08-29T18:03:46.000+0000" }, { "id": "394657", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Added the docs-phrase [here|https://github.com/appcelerator/titanium_mobile/pull/8284] by referencing the TiUIView docs and adding a note about using the correct event.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-29T18:10:24.000+0000", "updated": "2016-08-29T18:10:24.000+0000" }, { "id": "413976", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-20T21:26:10.000+0000", "updated": "2017-03-20T21:26:10.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }