Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1393] Button events bubble despite parent e.cancelBubble =false

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNot Our Bug
Resolution Date2014-11-14T23:44:29.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
LabelsTCSupportTriage, alloy, bubble, button, ios, sdk-3.4
ReporterSamie Syed
AssigneeMauro Parra-Miranda
Created2014-11-13T17:02:39.000+0000
Updated2016-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.

Comments

  1. Mauro Parra-Miranda 2014-11-14

    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
  2. Samie Syed 2014-11-15

    Hi, What if the button is in the nav bar? Thanks

JSON Source