{"action":"created","issue":{"url":"https://api.github.com/repos/Polymer/polymer/issues/1921","labels_url":"https://api.github.com/repos/Polymer/polymer/issues/1921/labels{/name}","comments_url":"https://api.github.com/repos/Polymer/polymer/issues/1921/comments","events_url":"https://api.github.com/repos/Polymer/polymer/issues/1921/events","html_url":"https://github.com/Polymer/polymer/issues/1921","id":89574777,"number":1921,"title":"Normalized event difference with ShadowDOM and Shady","user":{"login":"atoy40","id":229339,"avatar_url":"https://avatars.githubusercontent.com/u/229339?v=3","gravatar_id":"","url":"https://api.github.com/users/atoy40","html_url":"https://github.com/atoy40","followers_url":"https://api.github.com/users/atoy40/followers","following_url":"https://api.github.com/users/atoy40/following{/other_user}","gists_url":"https://api.github.com/users/atoy40/gists{/gist_id}","starred_url":"https://api.github.com/users/atoy40/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atoy40/subscriptions","organizations_url":"https://api.github.com/users/atoy40/orgs","repos_url":"https://api.github.com/users/atoy40/repos","events_url":"https://api.github.com/users/atoy40/events{/privacy}","received_events_url":"https://api.github.com/users/atoy40/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Polymer/polymer/labels/p2","name":"p2","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"azakus","id":46725,"avatar_url":"https://avatars.githubusercontent.com/u/46725?v=3","gravatar_id":"","url":"https://api.github.com/users/azakus","html_url":"https://github.com/azakus","followers_url":"https://api.github.com/users/azakus/followers","following_url":"https://api.github.com/users/azakus/following{/other_user}","gists_url":"https://api.github.com/users/azakus/gists{/gist_id}","starred_url":"https://api.github.com/users/azakus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azakus/subscriptions","organizations_url":"https://api.github.com/users/azakus/orgs","repos_url":"https://api.github.com/users/azakus/repos","events_url":"https://api.github.com/users/azakus/events{/privacy}","received_events_url":"https://api.github.com/users/azakus/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-06-19T14:13:52Z","updated_at":"2015-06-23T17:24:19Z","closed_at":null,"body":"Hello,\r\n\r\ni've an element which contains a paper-fab, and a tap event as :\r\n```html\r\n<dom-module id=\"my-toolbar\">\r\n  <template>\r\n     <paper-fab on-tap=\"myHandler\" icon=\"...\"></paper-fab>\r\n     <paper-fab on-tap=\"myHandler\" icon=\"...\"></paper-fab>\r\n     <paper-fab on-tap=\"myHandler\" icon=\"...\"></paper-fab>\r\n  </template>\r\n</dom-module>\r\n<script>\r\n  Polymer({\r\n    is: 'my-toolbar',\r\n    myHandler: function(e) {\r\n      console.log(Polymer.dom(e));\r\n    }\r\n  });\r\n</script>\r\n```\r\n\r\nThis element is instantiate into a tree of other elements, starting from a top element \"my-app\" instantiated in the html body.\r\nI've one unique handler for 3 paper-fab. So in the handler, i want to identify the clicked paper-fab.\r\nbut i found in the normalized event object that :\r\n\r\n- with Shady\r\n  - localTarget : is the app top element \"my-app\"\r\n  - rootTarget : the \"sub element\" of paper-fab you click on (for example iron-icon if you click at the center)\r\n\r\n- with ShadowDOM\r\n  - localTarget : is the app top element \"my-app\" too (is it correct ?)\r\n  - rootTarget : is the paper-fab element you click on (seems to be the correct behavior to me)\r\n\r\nAnthony."},"comment":{"url":"https://api.github.com/repos/Polymer/polymer/issues/comments/114578349","html_url":"https://github.com/Polymer/polymer/issues/1921#issuecomment-114578349","issue_url":"https://api.github.com/repos/Polymer/polymer/issues/1921","id":114578349,"user":{"login":"kevinpschaaf","id":1354932,"avatar_url":"https://avatars.githubusercontent.com/u/1354932?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinpschaaf","html_url":"https://github.com/kevinpschaaf","followers_url":"https://api.github.com/users/kevinpschaaf/followers","following_url":"https://api.github.com/users/kevinpschaaf/following{/other_user}","gists_url":"https://api.github.com/users/kevinpschaaf/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinpschaaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinpschaaf/subscriptions","organizations_url":"https://api.github.com/users/kevinpschaaf/orgs","repos_url":"https://api.github.com/users/kevinpschaaf/repos","events_url":"https://api.github.com/users/kevinpschaaf/events{/privacy}","received_events_url":"https://api.github.com/users/kevinpschaaf/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T17:24:19Z","updated_at":"2015-06-23T17:24:19Z","body":"Right, the object returned from `Polymer.dom(e)` has getters that are evaluated lazily, and the event target changes once the event loop completes, so you may see different results if you expand the object on the console later.\r\n\r\nYou should never expect to see `x-test` as a target unless the event handler was placed on or above `x-test`.  Since the handler is on elements in the template stamped _inside_ of `x-test`, `localTarget` gives you the first element _inside_ the `x-test` scope (but at or below where the handler was added) as the event bubbles up, while `rootTarget` should give you the deepest-most element irrespective of scope boundaries (which may or may not be the same thing).\r\n\r\nAs I said, the bug appears to originate in the gesture system, as it is only the gesture-simulated events that have incorrect targets, not native ones like `click`."}}