{"action":"created","issue":{"url":"https://api.github.com/repos/OnsenUI/OnsenUI/issues/2267","repository_url":"https://api.github.com/repos/OnsenUI/OnsenUI","labels_url":"https://api.github.com/repos/OnsenUI/OnsenUI/issues/2267/labels{/name}","comments_url":"https://api.github.com/repos/OnsenUI/OnsenUI/issues/2267/comments","events_url":"https://api.github.com/repos/OnsenUI/OnsenUI/issues/2267/events","html_url":"https://github.com/OnsenUI/OnsenUI/pull/2267","id":278110982,"number":2267,"title":"Fix tappable ons-list-item with tappable content","user":{"login":"zabojad","id":1238030,"avatar_url":"https://avatars0.githubusercontent.com/u/1238030?v=4","gravatar_id":"","url":"https://api.github.com/users/zabojad","html_url":"https://github.com/zabojad","followers_url":"https://api.github.com/users/zabojad/followers","following_url":"https://api.github.com/users/zabojad/following{/other_user}","gists_url":"https://api.github.com/users/zabojad/gists{/gist_id}","starred_url":"https://api.github.com/users/zabojad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zabojad/subscriptions","organizations_url":"https://api.github.com/users/zabojad/orgs","repos_url":"https://api.github.com/users/zabojad/repos","events_url":"https://api.github.com/users/zabojad/events{/privacy}","received_events_url":"https://api.github.com/users/zabojad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-30T12:57:58Z","updated_at":"2017-11-30T13:48:12Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/OnsenUI/OnsenUI/pulls/2267","html_url":"https://github.com/OnsenUI/OnsenUI/pull/2267","diff_url":"https://github.com/OnsenUI/OnsenUI/pull/2267.diff","patch_url":"https://github.com/OnsenUI/OnsenUI/pull/2267.patch"},"body":"When we have a tappable ons-list-item with tappable content (buttons, inputs, ...), the ons-list-item \"reacts\" to `touchstart` and `touchend` events without the possibility to shortcut it. Even listening to thoses events with the `useCapure` flag set to `true` from the tappable content elements and calling `e.stopPropagation()` and `e.preventDefault()` won't help because `ons-list-item` is a web component and its internal event listeners seem to be called before any other..."},"comment":{"url":"https://api.github.com/repos/OnsenUI/OnsenUI/issues/comments/348192608","html_url":"https://github.com/OnsenUI/OnsenUI/pull/2267#issuecomment-348192608","issue_url":"https://api.github.com/repos/OnsenUI/OnsenUI/issues/2267","id":348192608,"user":{"login":"frandiox","id":1634092,"avatar_url":"https://avatars3.githubusercontent.com/u/1634092?v=4","gravatar_id":"","url":"https://api.github.com/users/frandiox","html_url":"https://github.com/frandiox","followers_url":"https://api.github.com/users/frandiox/followers","following_url":"https://api.github.com/users/frandiox/following{/other_user}","gists_url":"https://api.github.com/users/frandiox/gists{/gist_id}","starred_url":"https://api.github.com/users/frandiox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frandiox/subscriptions","organizations_url":"https://api.github.com/users/frandiox/orgs","repos_url":"https://api.github.com/users/frandiox/repos","events_url":"https://api.github.com/users/frandiox/events{/privacy}","received_events_url":"https://api.github.com/users/frandiox/received_events","type":"User","site_admin":false},"created_at":"2017-11-30T13:48:12Z","updated_at":"2017-11-30T13:48:12Z","author_association":"OWNER","body":"@zabojad Hi, thanks for the PR! I was thinking about this after reading your question in the forum and came up with a possible solution. Your PR works in many cases but not in all of them because some components are made of plain `span` and `div`. Therefore, rather than hardcoding a list of elements, let's do it in two steps:\r\n\r\n1. I think every `/^ons-/i.test(event.target.tagName)` can be ignored.\r\n2. Any `event.target.hasAttribute('prevent-tap')` can also be ignored (attribute manually specified by the user).\r\n3. If there is any element between `event.target` and `this` (the ons-list-item itself) in the DOM tree that fulfills any of the previous statements, it should also be ignored:\r\n\r\n```javascript\r\nutil.findParent(\r\n  event.target,\r\n  parent => /^ons-/i.test(parent.tagName) || parent.hasAttribute('prevent-tap'),\r\n  parent => parent === this\r\n);\r\n```\r\n\r\nWhat do you think about that?\r\n\r\nCC @asial-matagawa "}}
{"actor":{"display_login":"frandiox"}}