[bug]: Close megadropdown when focus leaves the header #4272
Labels
🐞 bug
Something isn't working
📦 components
Related to the @swisspost/design-system-components package
Milestone
Describe the bug
While the current focus is in the header and a megadropdown is open, the focus should always be visible. As soon as the focus leaves the header and goes to the first focusable element on the page, the focus could be hidden by the open megadropdown. As a safety measure, the megadropdown should close when focus leaves the header.
Question: should this behaviour also be the same if the focus is lost due to a click event? This will close the megadropdown on outside click which should probably not be the case.
To Reproduce
Steps to reproduce the behavior:
tab
until the focus leaves the headerExpected behavior
The focused element should always be visible (https://www.w3.org/WAI/WCAG21/Understanding/focus-visible.html)
The text was updated successfully, but these errors were encountered: