{"action":"created","issue":{"url":"https://api.github.com/repos/visionmedia/page.js/issues/475","repository_url":"https://api.github.com/repos/visionmedia/page.js","labels_url":"https://api.github.com/repos/visionmedia/page.js/issues/475/labels{/name}","comments_url":"https://api.github.com/repos/visionmedia/page.js/issues/475/comments","events_url":"https://api.github.com/repos/visionmedia/page.js/issues/475/events","html_url":"https://github.com/visionmedia/page.js/pull/475","id":308077860,"number":475,"title":"Fix for anchors in shadow dom","user":{"login":"mgibas","id":530319,"avatar_url":"https://avatars3.githubusercontent.com/u/530319?v=4","gravatar_id":"","url":"https://api.github.com/users/mgibas","html_url":"https://github.com/mgibas","followers_url":"https://api.github.com/users/mgibas/followers","following_url":"https://api.github.com/users/mgibas/following{/other_user}","gists_url":"https://api.github.com/users/mgibas/gists{/gist_id}","starred_url":"https://api.github.com/users/mgibas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgibas/subscriptions","organizations_url":"https://api.github.com/users/mgibas/orgs","repos_url":"https://api.github.com/users/mgibas/repos","events_url":"https://api.github.com/users/mgibas/events{/privacy}","received_events_url":"https://api.github.com/users/mgibas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-23T15:37:08Z","updated_at":"2018-03-26T02:05:44Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/visionmedia/page.js/pulls/475","html_url":"https://github.com/visionmedia/page.js/pull/475","diff_url":"https://github.com/visionmedia/page.js/pull/475.diff","patch_url":"https://github.com/visionmedia/page.js/pull/475.patch"},"body":"In shadow dom we can not traverse `path` using `parentNode` cause there can be `document-element` in between other elements. Once `document-element` is found it will return from `onclick` (parentNode is `undefined`) and reload the page.\r\n\r\nWhy `path` array is build that way? No idea. Seems to be expected though cause `for` loop is also used in `iron-location` click handler - they should know a bit more about shadoDom :)\r\n\r\nhttps://github.com/PolymerElements/iron-location/blob/2486d275bef819aa3eedffee69158f695580d40f/iron-location.html#L342"},"comment":{"url":"https://api.github.com/repos/visionmedia/page.js/issues/comments/376026203","html_url":"https://github.com/visionmedia/page.js/pull/475#issuecomment-376026203","issue_url":"https://api.github.com/repos/visionmedia/page.js/issues/475","id":376026203,"user":{"login":"nick-woodward","id":9692284,"avatar_url":"https://avatars3.githubusercontent.com/u/9692284?v=4","gravatar_id":"","url":"https://api.github.com/users/nick-woodward","html_url":"https://github.com/nick-woodward","followers_url":"https://api.github.com/users/nick-woodward/followers","following_url":"https://api.github.com/users/nick-woodward/following{/other_user}","gists_url":"https://api.github.com/users/nick-woodward/gists{/gist_id}","starred_url":"https://api.github.com/users/nick-woodward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nick-woodward/subscriptions","organizations_url":"https://api.github.com/users/nick-woodward/orgs","repos_url":"https://api.github.com/users/nick-woodward/repos","events_url":"https://api.github.com/users/nick-woodward/events{/privacy}","received_events_url":"https://api.github.com/users/nick-woodward/received_events","type":"User","site_admin":false},"created_at":"2018-03-26T02:05:44Z","updated_at":"2018-03-26T02:05:44Z","author_association":"NONE","body":"Just another temporary workaround until this change and #476 are resolved.\r\n\r\n```js\r\n// TODO: Remove this once https://github.com/visionmedia/page.js/pull/475 is merged and deployed!\r\n// Personally wouldn't throw this logic into production as it \r\n// overrides the builtin path implementation in Chrome.\r\n// However it's a decent workaround for development purposes.\r\n// Throw this before any page.js logic is invoked.\r\nObject.defineProperty(Event.prototype, 'path', {\r\n  get: function() {\r\n    var path = this.composedPath && this.composedPath() || [this.target];\r\n    var anchor = null;\r\n    for (var i = 0; i < path.length; i++) {\r\n      var element = path[i];\r\n      if (element.tagName === 'A' && element.href) {\r\n        anchor = element;\r\n        break;\r\n      }\r\n    }\r\n    return [anchor];\r\n  }\r\n});\r\n```\r\n"}}
{"actor":{"display_login":"nick-woodward"}}