Skip to content

Commit

Permalink
Attach click event listener only to anchors
Browse files Browse the repository at this point in the history
This mitigates an issue when we use js-header-toggle for both menu buttons coming from govuk_template (which are marked-up with <a>) and for headers coming from govuk-frontend (marked-up with <button>) (alphagov/govuk-frontend#1270)
  • Loading branch information
alex-ju committed Apr 15, 2019
1 parent 989c920 commit 13d5352
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

## Unreleased

- Fix script in header component not being compatible with the govuk_template script (PR #818)
- Upgrade to govuk-frontend 2.10.0 (PR #817)

## 16.10.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict'

if (document.querySelectorAll && document.addEventListener) {
var els = document.querySelectorAll('.js-header-toggle')
var els = document.querySelectorAll('a.js-header-toggle')
var i
var _i
for (i = 0, _i = els.length; i < _i; i++) {
Expand Down

0 comments on commit 13d5352

Please sign in to comment.