event.stopPropogation not working in case if i use on-click on the parent element

34 views
Skip to first unread message

kru...@thoughtworks.com

unread,
Feb 5, 2015, 2:13:09 AM2/5/15
to polym...@googlegroups.com
I am trying to make image clickable. Polymer code looks like:

<div on-click={{clickHandler}}>
   <img src="xyz.jpg" />
</div>

in the handler i always get e.target as img, i tried doing e.stopPropogation it still does not detect click of div.

Any work around this one ??

robo...@gmail.com

unread,
Oct 9, 2015, 11:20:39 AM10/9/15
to Polymer, kru...@thoughtworks.com
I had the same problem and found that using e.currentTarget returned the parent element.

Reply all
Reply to author
Forward
0 new messages