What's a good example of using Polymer.dom(event)?

357 views
Skip to first unread message

Kevin Ashcraft

unread,
Apr 17, 2015, 12:50:18 PM4/17/15
to polym...@googlegroups.com
I'm trying to add an on-tap listener to a custom element, but do not know how to use Polymer.dom(event) to retarget the click/tap.

Arthur Evans

unread,
Apr 22, 2015, 8:30:22 PM4/22/15
to Kevin Ashcraft, polymer-dev
Hi Kevin,

Did you ever get an answer here? I think the answer is that you'd use it in your event handling code to get the correct path, localTarget and rootTarget.

So if your page handles an event fired by element A inside a element B's local DOM, Polymer.dom(event).localTarget would return element B, while Polymer.dom(event).rootTarget would return element A.

 

On Fri, Apr 17, 2015 at 9:50 AM, Kevin Ashcraft <kevas...@gmail.com> wrote:
I'm trying to add an on-tap listener to a custom element, but do not know how to use Polymer.dom(event) to retarget the click/tap.

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/a2765585-86c4-4f77-9d71-9c4101b72144%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Ashcraft

unread,
Apr 23, 2015, 9:02:03 AM4/23/15
to polym...@googlegroups.com, kevas...@gmail.com
Hey arthure! :) 

I hadn't figured out how to use it, but did discover that when an event is fired I could get the root dom-module target via e.target.lightParent

Thanks for replying! I'm sure I'll be needing Polymer.dom(event) soon enough.
Reply all
Reply to author
Forward
0 new messages