Hidden elements in the global header should not be focusable, i.e. the user should not be able to tab to the links in the global header. Currently, a user can select a link in the global header using keyboard 'tab' key even when it is collapsed.

User should only be able to focus on elements in the global header when it is expanded. This can be achieved through setting the global header to display: none when it is collapsed. Another possible way is to set tabindex:-1 for all links in the global header when it is collapsed, and tabindex:0 when it is expanded.
I'm not sure if that should be the behaviour. For people with visual impairments, it might be useful to allow the links to be focused by simply pressing Tab.
This is how I understand the behavior we want with keyboard navigation:
When the header is collapsed:
When the header is expanded:
^ @obulat That behavior sounds correct to me! We don't want elements not visible on screen to be focusable.
@obulat I would like to work on this issue.
@obulat Adding visibility: hidden; when the header is collapsed and visibility: visible; when the header is expanded solves the problem.
Should I go ahead with this solution?
If not then what value should I use for opposite of display: none; as there is no literal opposite like visibility: hidden;
Instead of visibility: hidden; should I use visibility: collapsed;?
Most helpful comment
@obulat I would like to work on this issue.