Skip to content

Commit

Permalink
Fix child elements in tab label breaking
Browse files Browse the repository at this point in the history
Fixes #1252
  • Loading branch information
hannalaakso committed May 15, 2019
1 parent 74f296b commit 22c1df4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/tabs/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ Tabs.prototype.unsetAttributes = function ($tab) {
}

Tabs.prototype.onTabClick = function (e) {
if (!e.target.classList.contains('govuk-tabs__tab')) {
// Allow events on child DOM elements to bubble up to tab parent
return false
}
e.preventDefault()
var $newTab = e.target
var $currentTab = this.getCurrentTab()
Expand Down

0 comments on commit 22c1df4

Please sign in to comment.