Skip to content

Commit

Permalink
Merge pull request #898 from nhsuk/fix-header-dropdown-issue
Browse files Browse the repository at this point in the history
Header drop down menu covers the top of the page contents
  • Loading branch information
roshaanbajwa authored Oct 19, 2023
2 parents 52a09e2 + 79a10f8 commit d1cfb58
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 34 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# NHS.UK frontend Changelog

## 8.0.2 - 019 October 2023

:wrench: **Fixes**

- Resolves the bug of the drop down menu covering the main content of the page ([PR 898](https://github.com/nhsuk/nhsuk-frontend/pull/898)).

## 8.0.1 - 02 October 2023

:wrench: **Fixes**
Expand Down
4 changes: 0 additions & 4 deletions app/components/header/header-service-name-with-nav.njk
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
'url' : '#',
'label' : 'Accessibility'
},
{
'url' : '#',
'label' : 'Design principles'
},
{
'url' : '#',
'label' : 'Community and contribution'
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nhsuk-frontend",
"version": "8.0.1",
"version": "8.0.2",
"description": "NHS.UK frontend contains the code you need to start building user interfaces for NHS websites and services.",
"scripts": {
"prepare": "gulp bundle",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ class Header {
*/

openMobileMenu() {
const marginBody = this.mobileMenu.offsetHeight
this.menuIsOpen = true
this.mobileMenu.classList.remove('nhsuk-header__drop-down--hidden')
const marginBody = this.mobileMenu.offsetHeight
this.navigation.style.marginBottom = `${marginBody}px`
this.mobileMenuToggleButton.setAttribute('aria-expanded', 'true')

Expand Down
55 changes: 29 additions & 26 deletions packages/components/header/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
</nav>
</div>


{% endif -%}

{% if showSearch == "true" and showNav == "false" %}
Expand Down Expand Up @@ -132,32 +133,34 @@
{% if showNav == "true" and params.primaryLinks and showSearch == "false" %}

</div>{# close nhsuk-header__container #}

<nav class="nhsuk-navigation" id="header-navigation" role="navigation" aria-label="Primary navigation">
<ul class="nhsuk-header__navigation-list">
{%- for item in params.primaryLinks %}
<li class="nhsuk-header__navigation-item">
<a class="nhsuk-header__navigation-link" href="{{item.url}}">
{{item.label}}
</a>
</li>
{%- endfor %}
<li class="nhsuk-header__navigation-item nhsuk-header__navigation-item--home">
<a class="nhsuk-header__navigation-link" href="/">
Home
</a>
</li>
<li class="nhsuk-mobile-menu-container">
<button class="nhsuk-header__menu-toggle nhsuk-header__navigation-link" id="toggle-menu" aria-expanded="false">
<span class="nhsuk-u-visually-hidden">Browse</span>
More
<svg class="nhsuk-icon nhsuk-icon__chevron-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M15.5 12a1 1 0 0 1-.29.71l-5 5a1 1 0 0 1-1.42-1.42l4.3-4.29-4.3-4.29a1 1 0 0 1 1.42-1.42l5 5a1 1 0 0 1 .29.71z"></path>
</svg>
</button>
</li>
</ul>
</nav>

<div class="nhsuk-navigation-container">
<nav class="nhsuk-navigation" id="header-navigation" role="navigation" aria-label="Primary navigation">
<ul class="nhsuk-header__navigation-list">
{%- for item in params.primaryLinks %}
<li class="nhsuk-header__navigation-item">
<a class="nhsuk-header__navigation-link" href="{{item.url}}">
{{item.label}}
</a>
</li>
{%- endfor %}
<li class="nhsuk-header__navigation-item nhsuk-header__navigation-item--home">
<a class="nhsuk-header__navigation-link" href="/">
Home
</a>
</li>
<li class="nhsuk-mobile-menu-container">
<button class="nhsuk-header__menu-toggle nhsuk-header__navigation-link" id="toggle-menu" aria-expanded="false">
<span class="nhsuk-u-visually-hidden">Browse</span>
More
<svg class="nhsuk-icon nhsuk-icon__chevron-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M15.5 12a1 1 0 0 1-.29.71l-5 5a1 1 0 0 1-1.42-1.42l4.3-4.29-4.3-4.29a1 1 0 0 1 1.42-1.42l5 5a1 1 0 0 1 .29.71z"></path>
</svg>
</button>
</li>
</ul>
</nav>
</div>

{% endif -%}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d1cfb58

Please sign in to comment.