{"action":"created","issue":{"url":"https://api.github.com/repos/18F/web-design-standards/issues/1762","repository_url":"https://api.github.com/repos/18F/web-design-standards","labels_url":"https://api.github.com/repos/18F/web-design-standards/issues/1762/labels{/name}","comments_url":"https://api.github.com/repos/18F/web-design-standards/issues/1762/comments","events_url":"https://api.github.com/repos/18F/web-design-standards/issues/1762/events","html_url":"https://github.com/18F/web-design-standards/issues/1762","id":211766358,"number":1762,"title":"Buttons within accordions get assigned .usa-button-accordion event listeners","user":{"login":"jasonkaedingICE","id":20419703,"avatar_url":"https://avatars0.githubusercontent.com/u/20419703?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonkaedingICE","html_url":"https://github.com/jasonkaedingICE","followers_url":"https://api.github.com/users/jasonkaedingICE/followers","following_url":"https://api.github.com/users/jasonkaedingICE/following{/other_user}","gists_url":"https://api.github.com/users/jasonkaedingICE/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonkaedingICE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonkaedingICE/subscriptions","organizations_url":"https://api.github.com/users/jasonkaedingICE/orgs","repos_url":"https://api.github.com/users/jasonkaedingICE/repos","events_url":"https://api.github.com/users/jasonkaedingICE/events{/privacy}","received_events_url":"https://api.github.com/users/jasonkaedingICE/received_events","type":"User","site_admin":false},"labels":[{"id":253403358,"url":"https://api.github.com/repos/18F/web-design-standards/labels/[Priority]%20Critical","name":"[Priority] Critical","color":"e31c3d","default":false},{"id":550897990,"url":"https://api.github.com/repos/18F/web-design-standards/labels/[Status]%20Accepted","name":"[Status] Accepted","color":"ededed","default":false},{"id":214029009,"url":"https://api.github.com/repos/18F/web-design-standards/labels/[Type]%20Bug","name":"[Type] Bug","color":"00a6d2","default":false}],"state":"open","locked":false,"assignee":{"login":"shawnbot","id":113896,"avatar_url":"https://avatars1.githubusercontent.com/u/113896?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnbot","html_url":"https://github.com/shawnbot","followers_url":"https://api.github.com/users/shawnbot/followers","following_url":"https://api.github.com/users/shawnbot/following{/other_user}","gists_url":"https://api.github.com/users/shawnbot/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnbot/subscriptions","organizations_url":"https://api.github.com/users/shawnbot/orgs","repos_url":"https://api.github.com/users/shawnbot/repos","events_url":"https://api.github.com/users/shawnbot/events{/privacy}","received_events_url":"https://api.github.com/users/shawnbot/received_events","type":"User","site_admin":false},"assignees":[{"login":"shawnbot","id":113896,"avatar_url":"https://avatars1.githubusercontent.com/u/113896?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnbot","html_url":"https://github.com/shawnbot","followers_url":"https://api.github.com/users/shawnbot/followers","following_url":"https://api.github.com/users/shawnbot/following{/other_user}","gists_url":"https://api.github.com/users/shawnbot/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnbot/subscriptions","organizations_url":"https://api.github.com/users/shawnbot/orgs","repos_url":"https://api.github.com/users/shawnbot/repos","events_url":"https://api.github.com/users/shawnbot/events{/privacy}","received_events_url":"https://api.github.com/users/shawnbot/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/18F/web-design-standards/milestones/37","html_url":"https://github.com/18F/web-design-standards/milestone/37","labels_url":"https://api.github.com/repos/18F/web-design-standards/milestones/37/labels","id":2248343,"number":37,"title":"St. Patrick's Day Sprint","description":"Start date: March 13\r\nEnd date: March 24","creator":{"login":"juliaelman","id":955558,"avatar_url":"https://avatars0.githubusercontent.com/u/955558?v=3","gravatar_id":"","url":"https://api.github.com/users/juliaelman","html_url":"https://github.com/juliaelman","followers_url":"https://api.github.com/users/juliaelman/followers","following_url":"https://api.github.com/users/juliaelman/following{/other_user}","gists_url":"https://api.github.com/users/juliaelman/gists{/gist_id}","starred_url":"https://api.github.com/users/juliaelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliaelman/subscriptions","organizations_url":"https://api.github.com/users/juliaelman/orgs","repos_url":"https://api.github.com/users/juliaelman/repos","events_url":"https://api.github.com/users/juliaelman/events{/privacy}","received_events_url":"https://api.github.com/users/juliaelman/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":5,"state":"open","created_at":"2017-01-12T19:37:37Z","updated_at":"2017-03-17T18:53:34Z","due_on":"2017-03-25T07:00:00Z","closed_at":null},"comments":4,"created_at":"2017-03-03T18:31:06Z","updated_at":"2017-03-20T20:48:19Z","closed_at":null,"body":"## Description\r\n\r\nWhen a button is placed within an accordion content div, the button gets assigned event listeners as if it were the usa-accordion-button.  Clicking the button will trigger the accordion to close when it shouldn't.\r\n\r\nIn the changes since 0.9.x, it seems that care was taken to avoid some of the problems that were present in 0.8.x.  However, it seems one line of code was missed.\r\n\r\n## Steps to reproduce the issue\r\n\r\n1. Use this code to test:\r\n````\r\n<ul class=\"usa-accordion\">\r\n  <li>\r\n    <button class=\"usa-accordion-button\" aria-expanded=\"false\" aria-controls=\"formContent\">View form</button>\r\n\r\n    <div id=\"formContent\" class=\"usa-accordion-content\">\r\n      <form>\r\n        <label for=\"my-input\">Number between 1 and 5:</label>\r\n        <input id=\"my-input\" type=\"number\" min=\"1\" max=\"5\" />\r\n        <button type=\"submit\">Submit</button>\r\n      </form>\r\n    </div>\r\n  </li>\r\n</ul>\r\n````\r\n\r\n2. Type in a number greater than 5\r\n3. Click the submit button\r\n4. The accordion closes, and a JS error occurs because it cannot render the validation message\r\n\r\n## Fixing the problem\r\nIn uswds.js line 656 does not have the same CSS selector as line 712:\r\n````\r\nvar buttons = select('button', this.root); // line 656\r\nvar buttons = this.$('ul > li > button, .usa-accordion-button'); // line 712\r\n````\r\n\r\nChanging line 656 to the following solves the problem (tested locally):\r\n`var buttons = select('ul > li > button, .usa-accordion-button');`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/18F/web-design-standards/issues/comments/287892909","html_url":"https://github.com/18F/web-design-standards/issues/1762#issuecomment-287892909","issue_url":"https://api.github.com/repos/18F/web-design-standards/issues/1762","id":287892909,"user":{"login":"shawnbot","id":113896,"avatar_url":"https://avatars1.githubusercontent.com/u/113896?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnbot","html_url":"https://github.com/shawnbot","followers_url":"https://api.github.com/users/shawnbot/followers","following_url":"https://api.github.com/users/shawnbot/following{/other_user}","gists_url":"https://api.github.com/users/shawnbot/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnbot/subscriptions","organizations_url":"https://api.github.com/users/shawnbot/orgs","repos_url":"https://api.github.com/users/shawnbot/repos","events_url":"https://api.github.com/users/shawnbot/events{/privacy}","received_events_url":"https://api.github.com/users/shawnbot/received_events","type":"User","site_admin":false},"created_at":"2017-03-20T20:48:19Z","updated_at":"2017-03-20T20:48:19Z","body":"Whoops, you're right! How about [this one](https://jsfiddle.net/47Lpu62z/2/)? I lazily added an `onsubmit=\"return false;\"` form attribute to prevent the form from submitting (so we can see what's happening), but otherwise it appears to be exactly the same."}}
{"actor":{"display_login":"shawnbot"}}