GSto GSto - 1 year ago 82
iOS Question

How do I prevent event bubbling in a Titanium Alloy view?

In the documentation, it seems that you can prevent bubbling by passing an arguments to an click event on a text field:!/api/Titanium.UI.TextField-event-click

Using their new Alloy framework, I have a textfield declared like so:

<TextField id='name' onClick='doStuff' />

and in my controller I have this function:

function doStuff(e) {

However, this element is wrapped in a container element which also has an onClick event, and I would like to prevent that one from firing when I click on the text field. how can I accomplish this?

Answer Source


function doStuff(e){
    e.cancelBubble = true;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download