visitscotland / vs-component-library

VisitScotland Component Library
Other
0 stars 0 forks source link

feat(meganav): close dropdown when tabbing out of it #412

Closed mjpvs closed 1 month ago

mjpvs commented 1 month ago

Currently you can tab past the end of a meganav dropdown, continue along the main menu and then tab behind the open meganav producing some confusing results. The two options were either forcing the user to loop around inside the dropdown until you actually hit the close button, or auto closing it when you tab past the end of the nav (and off the close button, as the last item in it). The former option seems more confusing, especially for visually impaired users as it isn't clear why you're being looped around inside this box making no progress. The latter seems visually clear for people who can see the screen (as the nav closes and focus moves to the next meganav title) and intuitive for people who cannot, as they simply continue to progress through the navigation