Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Close megadropdown when focus leaves the header #4272

Closed
gfellerph opened this issue Dec 13, 2024 · 0 comments · Fixed by #4324
Closed

[bug]: Close megadropdown when focus leaves the header #4272

gfellerph opened this issue Dec 13, 2024 · 0 comments · Fixed by #4324
Assignees
Labels
🐞 bug Something isn't working 📦 components Related to the @swisspost/design-system-components package
Milestone

Comments

@gfellerph
Copy link
Member

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:

  1. Use the keyboard to open the megadropdown
  2. Press tab until the focus leaves the header

Expected behavior
The focused element should always be visible (https://www.w3.org/WAI/WCAG21/Understanding/focus-visible.html)

@gfellerph gfellerph added 🐞 bug Something isn't working 📦 components Related to the @swisspost/design-system-components package labels Dec 13, 2024
@gfellerph gfellerph added this to the PPNL Support milestone Dec 13, 2024
@gfellerph gfellerph moved this from 👀 Triage to 💻 Ready for development in Design System Production Board Dec 16, 2024
@myrta2302 myrta2302 self-assigned this Dec 17, 2024
@myrta2302 myrta2302 moved this from 💻 Ready for development to 🕹️ Coding in progress in Design System Production Board Dec 17, 2024
@myrta2302 myrta2302 linked a pull request Dec 17, 2024 that will close this issue
@myrta2302 myrta2302 moved this from 🕹️ Coding in progress to 🤬 Dev in Code Review in Design System Production Board Dec 17, 2024
@github-project-automation github-project-automation bot moved this from 🤬 Dev in Code Review to 🚀 Done in Design System Production Board Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📦 components Related to the @swisspost/design-system-components package
Projects
Status: 🚀 Done
Development

Successfully merging a pull request may close this issue.

2 participants