{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-library/issues/424","labels_url":"https://api.github.com/repos/google/closure-library/issues/424/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-library/issues/424/comments","events_url":"https://api.github.com/repos/google/closure-library/issues/424/events","html_url":"https://github.com/google/closure-library/pull/424","id":60321051,"number":424,"title":"Do not rely on targetTouches for determining \"relevant\" touch","user":{"login":"elemoine","id":76594,"avatar_url":"https://avatars.githubusercontent.com/u/76594?v=3","gravatar_id":"","url":"https://api.github.com/users/elemoine","html_url":"https://github.com/elemoine","followers_url":"https://api.github.com/users/elemoine/followers","following_url":"https://api.github.com/users/elemoine/following{/other_user}","gists_url":"https://api.github.com/users/elemoine/gists{/gist_id}","starred_url":"https://api.github.com/users/elemoine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elemoine/subscriptions","organizations_url":"https://api.github.com/users/elemoine/orgs","repos_url":"https://api.github.com/users/elemoine/repos","events_url":"https://api.github.com/users/elemoine/events{/privacy}","received_events_url":"https://api.github.com/users/elemoine/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/closure-library/labels/cla:%20yes","name":"cla: yes","color":"009800"}],"state":"closed","locked":false,"assignee":{"login":"joeltine","id":13138272,"avatar_url":"https://avatars.githubusercontent.com/u/13138272?v=3","gravatar_id":"","url":"https://api.github.com/users/joeltine","html_url":"https://github.com/joeltine","followers_url":"https://api.github.com/users/joeltine/followers","following_url":"https://api.github.com/users/joeltine/following{/other_user}","gists_url":"https://api.github.com/users/joeltine/gists{/gist_id}","starred_url":"https://api.github.com/users/joeltine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeltine/subscriptions","organizations_url":"https://api.github.com/users/joeltine/orgs","repos_url":"https://api.github.com/users/joeltine/repos","events_url":"https://api.github.com/users/joeltine/events{/privacy}","received_events_url":"https://api.github.com/users/joeltine/received_events","type":"User","site_admin":false},"milestone":null,"comments":23,"created_at":"2015-03-09T10:02:40Z","updated_at":"2015-08-16T15:32:57Z","closed_at":"2015-08-12T22:16:52Z","pull_request":{"url":"https://api.github.com/repos/google/closure-library/pulls/424","html_url":"https://github.com/google/closure-library/pull/424","diff_url":"https://github.com/google/closure-library/pull/424.diff","patch_url":"https://github.com/google/closure-library/pull/424.patch"},"body":"[`goog.events.BrowserEvent#init`](https://github.com/google/closure-library/blob/bdf0ea0aa60038928c0aea154645e3f1bcbd393e/closure/goog/events/browserevent.js#L226-L234) and [`goog.style.getClientPosition`](https://github.com/google/closure-library/blob/bdf0ea0aa60038928c0aea154645e3f1bcbd393e/closure/goog/style/style.js#L848-L853) currently make the same mistake: they use `event.targetTouches[0]` as the \"relevant\" touch.\r\n\r\nAs [mdn](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/targetTouches) documents it, `targetTouches` includes « the Touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element ». So if there are multiple touches on the surface `targetTouches[0]` may not be the touch that caused the current event to happen!\r\n\r\nThis pull request fixes both `goog.events.BrowserEvent#init` and `goog.style.getClientPosition` by relying on `changedTouches[0]` instead. [`changedTouches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/changedTouches) includes « the Touch objects for touch points that contributed to this touch event », so using `changedTouches[0]` rather than `targetTouches[0]` is more correct.\r\n\r\nPlease review.\r\n\r\nFixes #337."},"comment":{"url":"https://api.github.com/repos/google/closure-library/issues/comments/131574007","html_url":"https://github.com/google/closure-library/pull/424#issuecomment-131574007","issue_url":"https://api.github.com/repos/google/closure-library/issues/424","id":131574007,"user":{"login":"joeltine","id":13138272,"avatar_url":"https://avatars.githubusercontent.com/u/13138272?v=3","gravatar_id":"","url":"https://api.github.com/users/joeltine","html_url":"https://github.com/joeltine","followers_url":"https://api.github.com/users/joeltine/followers","following_url":"https://api.github.com/users/joeltine/following{/other_user}","gists_url":"https://api.github.com/users/joeltine/gists{/gist_id}","starred_url":"https://api.github.com/users/joeltine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeltine/subscriptions","organizations_url":"https://api.github.com/users/joeltine/orgs","repos_url":"https://api.github.com/users/joeltine/repos","events_url":"https://api.github.com/users/joeltine/events{/privacy}","received_events_url":"https://api.github.com/users/joeltine/received_events","type":"User","site_admin":false},"created_at":"2015-08-16T15:32:57Z","updated_at":"2015-08-16T15:32:57Z","body":"Can you expand on why you don't trust `changedTouches` or `targetTouches`?"}}