{ "id": "65712", "key": "TIMOB-4198", "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": "11356", "description": "Mobile 1.8.0 M03", "name": "Sprint 2011-24", "archived": true, "released": true, "releaseDate": "2011-06-20" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-10-27T15:43:34.000+0000", "created": "2011-05-24T10:03:04.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-10-27T15:43:34.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": "h1. Problem\r\nRemoving an event listener from an object causes that object and all children objects to not receive any events (including events that were not removed from it).\r\n\r\nh2. Sample Code\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\r\n\r\nvar button = Ti.UI.createButton({\r\n title: 'Remove A Listener',\r\n top: 10, left: 10, right: 10, height: 50\r\n});\r\nfunction listenerToRemove() {}\r\nwin.addEventListener('junk', listenerToRemove);\r\nbutton.addEventListener('click', function () {\r\n alert('Removed!');\r\n win.removeEventListener('junk', listenerToRemove);\r\n});\r\nwin.add(button);\r\n\r\nwin.open();\r\n{code}\r\n\r\nh2. How To Reproduce\r\n# Drop the above code in an app.js\r\n# When the app launches, a listener will be added for the \"junk\" event\r\n# Click the button, and \"junk\" will no longer be listened for\r\n# Try to click the button again. If nothing happens, this bug exists.\r\n\r\nh2. Tested On\r\nBROKEN in iPhone Simulator 4.2 on Ti Mobile SDK 1.7.0.RC1\r\nBROKEN in iPhone Simulator 4.2 on Ti Mobile SDK 1.6.2\r\nWORKS on Android Samsung EPIC 4G 2.3 on Ti Mobile SDK 1.7.0.RC1\r\n\r\nh2. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-445715", "attachment": [], "flagged": false, "summary": "iOS: removeEventListener Removes All Events", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "156677", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is actually due to the window treating the event removal as reason to turn off user interaction. If you replace 'junk' with 'click', this may still happen even after the codefix. Is this a new bug or a different bug?", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-13T19:53:19.000+0000", "updated": "2011-06-13T19:53:19.000+0000" }, { "id": "156724", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "I'm not sure what you mean. If calling \"removeEventListener\" is causing something to turn off its user interaction, that seems like the behavior we're seeing with this bug.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-06-14T09:55:52.000+0000", "updated": "2011-06-14T09:55:52.000+0000" }, { "id": "157110", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "temporarily turning of customer flag for a test.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-19T21:21:38.000+0000", "updated": "2011-06-19T21:21:38.000+0000" }, { "id": "157111", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "re-enabling customer field.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-19T21:22:48.000+0000", "updated": "2011-06-19T21:22:48.000+0000" }, { "id": "157247", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is outside the scope of this bug, but may be of issue later on: Whither multi-touch? It's similarly effected, but there are some complexities in this.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-20T17:40:23.000+0000", "updated": "2011-06-20T17:40:23.000+0000" }, { "id": "157341", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull was accepted", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-21T17:02:19.000+0000", "updated": "2011-06-21T17:02:19.000+0000" }, { "id": "164023", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.8.0.v20110819142548\niPhone 4.3.4\niPad2 4.3.2\nMotorola Xoom 3.2\nNexus One 2.2.2", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-25T11:05:06.000+0000", "updated": "2011-08-25T11:05:06.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }