Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

8268 | Mobile header accessibility #513

Conversation

chris-lawton
Copy link
Member

Link to Ticket

Description of Changes Made

  • Add and toggle aria-expanded attr on the mobile menu toggle
  • Add skip link to the homepage
  • Ensure hidden mobile menu links cannot receive focus
  • Remove 100% height from logo as it was preventing links further down the page from being clicked on smaller viewports
  • Move the mobile menu toggle button on the home page so it's in a logical tabbing order

How to Test

  • Visit the homepage locally and double check the above

MR Checklist

  • Add a description of your pull request and instructions for the reviewer to verify your work.
  • If your pull request is for a specific ticket, link to it in the description.
  • Stay on point and keep it small so the merge request can be easily reviewed.
  • Consider adding unit tests, especially for bug fixes. If you don't, tell us why.
  • Tests and linting passes.
  • Consider updating documentation. If you don't, tell us why.
  • If relevant, list the environments / browsers in which you tested your changes.

@@ -140,6 +140,11 @@
// Mobile menu
.mobile-nav & {
border-top: 1px solid hsla(0, 0%, 100%, 0.2);
visibility: hidden;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is not quite right with the links in the menu drop-down on the home page, where the focus is skipping straight past the drop down. I don't think it is this rule that is the issue - I haven't tracked it down from a quick look.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you got a video?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you go:

Screen.Recording.2023-08-01.at.18.50.55.mov

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging that this is still an issue although this is on staging now. I'll mention in stand-up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's to do with the order of the DOM elements on the home page template, as with other pages on staging the focus moves in a logical order - https://torchbox.staging.torchbox.com/digital-products/

On the homepage template I moved patterns/atoms/menu-button/menu-button.html down to here as otherwise the menu button was out of tab order - you can test this on https://torchbox.com/.

I think the fix will be to move patterns/molecules/navigation/mobile-nav.html to directly after menu-button.html on the homepage template I linked to above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had more of a look into this and think i've resolved it here - 08590fd

It looks like we were overriding the {% block header %} tag on home_page.html as we don't include the primary nav on it but moving elements out of that header messes up the tabbing order.

So i've now matched the contents of {% block header %} on home_page.html to that of base_page.html but add a conditional on the primary nav as to wether to include it or not.

This in turn also fixes inconsistencies in logo placement when comparing the homepage to any other page.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done - that sounds like a good solution. I haven't been able to test it as for some reason that commit you linked to is not associated with a branch - not sure how that is possible?!

Screenshot 2023-08-15 at 07 51 39

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased the branch shortly after which is probably why.

It's here now (140b626) but prob easier to checkout the branch and pull : )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that would do it - this is working nicely now - well done. I will update staging.

@helenb
Copy link
Member

helenb commented Jul 31, 2023

Everything looks good apart from an issue with tabbing the menu links in the dropdown on the home page. It would be nice if possible to also fix the 'more' button on the home page which currently can't be expanded via the keyboard.

@chris-lawton chris-lawton force-pushed the feature/8268-mobile-header-accessibility branch from d9fc072 to b0653a9 Compare July 31, 2023 14:19
@chris-lawton chris-lawton mentioned this pull request Aug 1, 2023
7 tasks
@chris-lawton
Copy link
Member Author

It would be nice if possible to also fix the 'more' button on the home page which currently can't be expanded via the keyboard.

Should be fixed in #509. I think it can be opened via keyboard but there's no focus state so you can't tell it's the active element.

@helenb
Copy link
Member

helenb commented Aug 1, 2023

It would be nice if possible to also fix the 'more' button on the home page which currently can't be expanded via the keyboard.

Should be fixed in #509. I think it can be opened via keyboard but there's no focus state so you can't tell it's the active element.

Great thanks - you're right it's just the focus state that was the issue

@chris-lawton chris-lawton force-pushed the feature/8268-mobile-header-accessibility branch from 08590fd to 140b626 Compare August 14, 2023 16:15
@helenb helenb changed the base branch from main to integration/hcm-accessibility-fixes August 16, 2023 09:15
@helenb helenb merged commit 5dec920 into integration/hcm-accessibility-fixes Aug 16, 2023
2 checks passed
@helenb helenb deleted the feature/8268-mobile-header-accessibility branch August 16, 2023 09:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants