[AC-1393] Button events bubble despite parent e.cancelBubble =false
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2014-11-14T23:44:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | TCSupportTriage, alloy, bubble, button, ios, sdk-3.4 |
Reporter | Samie Syed |
Assignee | Mauro Parra-Miranda |
Created | 2014-11-13T17:02:39.000+0000 |
Updated | 2016-03-08T07:37:48.000+0000 |
Description
To avoid a button being pressed multiple times quickly, I have set the following code:
imageTickReq[x].addEventListener("touchend", function(e) {
e.cancelBubble = true;
despite setting cancelBubble to true, my button event still bubbles, meaning the code is executed multiple times within that event listener.
Hello, The pattern for that should be adding a transparent view on top of the button, "disabling" it. You add it on the "onClick" event, and remove thre transparent view when your processing (i.e., function) ends. Best
Hi, What if the button is in the nav bar? Thanks