Skip to content

Normalized event difference with ShadowDOM and Shady #1921

Closed
@atoy40

Description

Hello,

i've an element which contains a paper-fab, and a tap event as :

<dom-module id="my-toolbar">
  <template>
     <paper-fab on-tap="myHandler" icon="..."></paper-fab>
     <paper-fab on-tap="myHandler" icon="..."></paper-fab>
     <paper-fab on-tap="myHandler" icon="..."></paper-fab>
  </template>
</dom-module>
<script>
  Polymer({
    is: 'my-toolbar',
    myHandler: function(e) {
      console.log(Polymer.dom(e));
    }
  });
</script>

This element is instantiate into a tree of other elements, starting from a top element "my-app" instantiated in the html body.
I've one unique handler for 3 paper-fab. So in the handler, i want to identify the clicked paper-fab.
but i found in the normalized event object that :

  • with Shady
    • localTarget : is the app top element "my-app"
    • rootTarget : the "sub element" of paper-fab you click on (for example iron-icon if you click at the center)
  • with ShadowDOM
    • localTarget : is the app top element "my-app" too (is it correct ?)
    • rootTarget : is the paper-fab element you click on (seems to be the correct behavior to me)

Anthony.

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions