Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child elements in a tab label break when clicked #1252

Closed
fofr opened this issue Mar 22, 2019 · 0 comments
Closed

Child elements in a tab label break when clicked #1252

fofr opened this issue Mar 22, 2019 · 0 comments
Assignees
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) ⚠️ high priority Used by the team when triaging 🕔 hours A well understood issue which we expect to take less than a day to resolve.
Milestone

Comments

@fofr
Copy link
Contributor

fofr commented Mar 22, 2019

In the Tabs component, if you include HTML within a tab label – eg an abbreviation tag. When you try and click that element the javascript events don’t bubble up correctly and the component breaks.

It's probably this line causing it:
https://github.com/alphagov/govuk-frontend/blob/master/src/components/tabs/tabs.js#L172

example-of-bug

Example nunJucks:

{{ govukTabs({
    items: [
      {
        label: 'Tab with child element, eg <strong>strong</strong>' | safe,
        id: "first",
        panel: {
          html: 'First tab'
        }
      },
      {
        label: 'Normal tab',
        id: "second",
        panel: {
          html: 'Second tab'
        }
      }
    ]
  }) }}
<li class="govuk-tabs__list-item">
  <a class="govuk-tabs__tab govuk-tabs__tab--selected" href="#first">
    Tab with child element, eg <strong>strong</strong>
  </a>
</li>
@dashouse dashouse added the awaiting triage Needs triaging by team label Mar 22, 2019
fofr added a commit to DFE-Digital/publish-teacher-training-prototype that referenced this issue Mar 22, 2019
Need to use pointer events none because of bug in tabs component:
alphagov/govuk-frontend#1252
@kellylee-gds kellylee-gds added 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) 🕔 hours A well understood issue which we expect to take less than a day to resolve. ⚠️ high priority Used by the team when triaging and removed awaiting triage Needs triaging by team labels Apr 10, 2019
@36degrees 36degrees self-assigned this May 14, 2019
@36degrees 36degrees assigned hannalaakso and unassigned 36degrees May 14, 2019
hannalaakso added a commit that referenced this issue May 15, 2019
hannalaakso added a commit that referenced this issue May 20, 2019
@36degrees 36degrees added this to the v3.0.0 milestone May 20, 2019
aliuk2012 pushed a commit that referenced this issue Jun 14, 2019
aliuk2012 pushed a commit that referenced this issue Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) ⚠️ high priority Used by the team when triaging 🕔 hours A well understood issue which we expect to take less than a day to resolve.
Projects
Development

No branches or pull requests

5 participants