alphagov / govuk_frontend_toolkit

❗️GOV.UK Frontend Toolkit is deprecated, and will only receive major bug fixes and security patches.
MIT License
403 stars 107 forks source link

Skip link not correctly moving focus in IE9/10/11 #397

Closed lawlesscreation closed 6 years ago

lawlesscreation commented 7 years ago

We've noticed that when using the "Skip to main content" link, it's not correctly moving the focus to the <main id="content" role="main"> in IE9/10/11.

This bug can also be seen when using https://www.gov.uk/vehicle-tax.

Steps to reproduce:

  1. Visit https://www.gov.uk/vehicle-tax in IE9/10/11
  2. Tab to and select the "Skip to main content" link with enter key

Expected behaviour: Subsequent tabbing should start from the <main> content. i.e.: the next tab press should move focus to the "In Welsh" link. Works in Chrome 57, Firefox 52 and Edge 14.

Actual behaviour: The next tab key press actually moves focus to the breadcrumb "Home" link in IE9/10/11, which is not within the <main> content area.

kr8n3r commented 6 years ago

This is an IE bug. It scrolls the page but doesn't change the focus. Applying tabindex=0 or tabindex=1 to the target element would fix the issue.

Can be applied directly or dynamically via javascript.

NickColley commented 6 years ago

Thanks @igloosi.

I'll close this out since it's fairly old, please re-open if you run into any issues! 😄