{"action":"created","issue":{"url":"https://api.github.com/repos/material-components/material-components-web/issues/1506","repository_url":"https://api.github.com/repos/material-components/material-components-web","labels_url":"https://api.github.com/repos/material-components/material-components-web/issues/1506/labels{/name}","comments_url":"https://api.github.com/repos/material-components/material-components-web/issues/1506/comments","events_url":"https://api.github.com/repos/material-components/material-components-web/issues/1506/events","html_url":"https://github.com/material-components/material-components-web/issues/1506","id":269519518,"number":1506,"title":"events / buttons are not properly registered on nested mdc-dialog","user":{"login":"iocast","id":1773589,"avatar_url":"https://avatars3.githubusercontent.com/u/1773589?v=4","gravatar_id":"","url":"https://api.github.com/users/iocast","html_url":"https://github.com/iocast","followers_url":"https://api.github.com/users/iocast/followers","following_url":"https://api.github.com/users/iocast/following{/other_user}","gists_url":"https://api.github.com/users/iocast/gists{/gist_id}","starred_url":"https://api.github.com/users/iocast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iocast/subscriptions","organizations_url":"https://api.github.com/users/iocast/orgs","repos_url":"https://api.github.com/users/iocast/repos","events_url":"https://api.github.com/users/iocast/events{/privacy}","received_events_url":"https://api.github.com/users/iocast/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-30T08:43:36Z","updated_at":"2017-11-06T18:36:47Z","closed_at":"2017-11-01T20:10:25Z","author_association":"NONE","body":"## Bug\r\n\r\n### What MDC-Web Version are you using?\r\n\r\nVersion: 0.23.0\r\n\r\n### What browser(s) is this bug affecting?\r\n\r\nTested under Chrome version 61.0.3163.100 and Safari version 11.0 (13604.1.38.1.6)\r\n\r\n### What are the steps to reproduce the bug?\r\n\r\nHere is a [codepen.io](https://codepen.io/anon/pen/NwWEQx) pen. Just do the following to reproduce the bug:\r\n\r\n1. open the first dialog (button: **SHOW DIALOG**)\r\n2. open the second dialog (button: **SHOW**)\r\n3. cancel or accept the second dialog.\r\n\r\n\r\n### What is the expected behavior?\r\n\r\nOnly closing the second dialog without closing the first (underlying) dialog.\r\n\r\n### What is the actual behavior?\r\n\r\nIt closes all dialogs.\r\n\r\n\r\n### Any other information you believe would be useful?\r\n\r\nAll dialog footer buttons are registered on the dialog as `footerBtnRipples_`. Thus the first dialog includes the footer buttons from the second dialog and listens to the events of the second dialog.\r\n\r\nAs you see in the [provided example](https://codepen.io/anon/pen/NwWEQx), the console log shows that the first dialog listens on / includes 4 buttons. The variable `footerBtnRipples_` includes 4 buttons for the first dialog and 2 buttons for the second dialog.\r\n\r\n### Findings\r\n\r\nI think the issue is [at line 47 of mdc-dialog/index.js](https://github.com/material-components/material-components-web/blob/8f98c7e24e6f9131aac2e461cdef934500e3ae74/packages/mdc-dialog/index.js#L47). The query selection does take all `.mdc-dialog__footer__button` without respecting the current hierarchy / nesting.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/material-components/material-components-web/issues/comments/342243154","html_url":"https://github.com/material-components/material-components-web/issues/1506#issuecomment-342243154","issue_url":"https://api.github.com/repos/material-components/material-components-web/issues/1506","id":342243154,"user":{"login":"Garbee","id":868301,"avatar_url":"https://avatars1.githubusercontent.com/u/868301?v=4","gravatar_id":"","url":"https://api.github.com/users/Garbee","html_url":"https://github.com/Garbee","followers_url":"https://api.github.com/users/Garbee/followers","following_url":"https://api.github.com/users/Garbee/following{/other_user}","gists_url":"https://api.github.com/users/Garbee/gists{/gist_id}","starred_url":"https://api.github.com/users/Garbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Garbee/subscriptions","organizations_url":"https://api.github.com/users/Garbee/orgs","repos_url":"https://api.github.com/users/Garbee/repos","events_url":"https://api.github.com/users/Garbee/events{/privacy}","received_events_url":"https://api.github.com/users/Garbee/received_events","type":"User","site_admin":false},"created_at":"2017-11-06T18:36:47Z","updated_at":"2017-11-06T18:36:47Z","author_association":"NONE","body":"Nested dialogs is one reason the dialog element should be used and polyfilled in where not available. It handles nesting by default in the browsers so these things \"just work\" as it were."}}
{"actor":{"display_login":"Garbee"}}