{ "id": "136720", "key": "TIMOB-17955", "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": "2014-09-17T12:48:40.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "TCSupport", "ios" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" }, { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "issuelinks": [], "assignee": null, "updated": "2021-01-03T16:12:44.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. Problem Description\r\nWhen clicking the same imageview continuously, onClick event of the imageview is called on the first click but not on succeeding clicks. Only if you wait for a few milliseconds to a second, before clicking again the same imageview, will the onClick event be fired/called.\r\n\r\nTo be able to replicate this, the same imageview should be clicked immediately and continuously.\r\n\r\nTo test this, I created a test project which contains an imageview and a label, which serves a counter. Every time the imageview is clicked, the counter label increments, which somehow corresponds to how many times it was clicked.\r\n\r\nWhen I click the imageview immediately and continuously, the counter label doesn't increment anymore after the first increment. But if I wait a few milliseconds/seconds before clicking again, then the counter label increments.\r\n\r\n\r\nh4. Steps to reproduce\r\n1. Create a classic Titanium project\r\n2. Add code to app.js:\r\n{code}\r\nvar win = Titanium.UI.createWindow({ \r\n backgroundColor:'#fff',\r\n layout:'vertical'\r\n});\r\n \r\nvar anImageView = Ti.UI.createImageView({\r\n image : '/image.png',\r\n width : 'auto',\r\n height : 'auto',\r\n top : 20,\r\n});\r\n \r\nvar count=0;\r\n \r\nvar aLabel = Ti.UI.createLabel({\r\n text : '0',\r\n color : '#000',\r\n font : {fontSize:18},\r\n height : 'auto',\r\n width : 'auto',\r\n top : 10,\r\n textAlign : 'center'\r\n});\r\n \r\nanImageView.addEventListener('click', function() {\r\n count++;\r\n aLabel.text=count;\r\n});\r\n \r\nwin.add(anImageView);\r\nwin.add(aLabel);\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "onClick event is not fired/called when the same button is clicked immediately", "creator": { "name": "ibautista.lancera", "key": "ibautista.lancera", "displayName": "Ivan Bautista", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ibautista.lancera", "key": "ibautista.lancera", "displayName": "Ivan Bautista", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti Mobile SDK version: Titanium SDK v3.3.0.GA / 3.4.0.GA\r\niOS version: 7.1\r\nXcode Version: Version 5.1.1 (5B1008)\r\nTesting on: iPhone 5c (7.1.2)", "comment": { "comments": [ { "id": "324284", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello [~ibautista.lancera]!\r\n\r\nPlease read the guide to create JIRA issues [here](https://wiki.appcelerator.org/display/guides2/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-SubmittingTickets), your report lacks: \r\n\r\n- Minimal Sample Code that reproduces the issue (i.e., in this case you talk about a image view; you can create a new mobile project in classic titanium and add a imageview with the included icons in the sample default project -two tabbed-). \r\n- Please provide all the info related to this: Ti Mobile SDK version, iOS version, Xcode Version, etc. \r\n\r\nThanks! ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-09-17T17:38:38.000+0000", "updated": "2014-09-17T17:38:38.000+0000" }, { "id": "324442", "author": { "name": "ibautista.lancera", "key": "ibautista.lancera", "displayName": "Ivan Bautista", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Updated the description and created a simple test project that replicates the issue.", "updateAuthor": { "name": "ibautista.lancera", "key": "ibautista.lancera", "displayName": "Ivan Bautista", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-18T08:08:10.000+0000", "updated": "2014-09-18T08:08:10.000+0000" }, { "id": "325088", "author": { "name": "ibautista.lancera", "key": "ibautista.lancera", "displayName": "Ivan Bautista", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Any Uopdates on this @Mauro Parra-Miranda?", "updateAuthor": { "name": "ibautista.lancera", "key": "ibautista.lancera", "displayName": "Ivan Bautista", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-23T03:08:47.000+0000", "updated": "2014-09-23T03:08:47.000+0000" }, { "id": "457960", "author": { "name": "john.staunton", "key": "john.staunton", "displayName": "John Staunton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue raised over 6 years ago, still exists as an issue today (iOS only, fine on Android)... debounce seems to exist on the event listener for iOS view clicks... ", "updateAuthor": { "name": "john.staunton", "key": "john.staunton", "displayName": "John Staunton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-01-02T21:11:33.000+0000", "updated": "2021-01-02T21:11:33.000+0000" }, { "id": "457961", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~john.staunton] just use {{singletap}} on iOS. Than you can click as fast as you can", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-01-03T15:34:34.000+0000", "updated": "2021-01-03T15:34:34.000+0000" }, { "id": "457962", "author": { "name": "john.staunton", "key": "john.staunton", "displayName": "John Staunton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Michael Gangolf, this is something I also tried - it's marginally better than 'click' but when doing some background processing after each click it still seems to have a debounce / inaccuracy. Instead, I've overlaid a transparent button on the view and used the onSingletap there as part of the button view controller - seems much more accurate than the addEventListener way...", "updateAuthor": { "name": "john.staunton", "key": "john.staunton", "displayName": "John Staunton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-01-03T16:12:44.000+0000", "updated": "2021-01-03T16:12:44.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }