Reputation: 49
I have a parent View with an click event and an attribute. within this i have 5 other elements. The issue is if i click on one of those elements it picks up the parents event listener and the code which is called checks to see if the clicked element has a specific data attribute.
is there any way to only apply the click event to the parent and not the children?
currently i am checking if the e.source has the attribute and if not checking the parent but it feels wrong.
Example code:
<View onClick='foo' target='someId'>
<imageView/>
<imageView/>
<imageView/>
</View>
Thanks
Upvotes: 1
Views: 564
Reputation: 2745
Setting bubbleParent: false
will work for you, and you can keep touchEnabled: true
just in case you still need touch events on ImageView
.
Upvotes: 2