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

Blocked aria-hidden on an element because its descendant retained focus. #541

Open
JohnCido opened this issue Dec 25, 2024 · 1 comment
Open

Comments

@JohnCido
Copy link

Describe the bug
DropdownMenu print this error when opened first time on a page:

Blocked aria-hidden on an element because its descendant retained focus. The focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.
Element with focus: button
Ancestor with aria-hidden:  <div id="app" aria-hidden="true">...

To Reproduce
Steps to reproduce the behavior:

  1. Go to official document page
  2. Open DevTool
  3. Click on first example button
  4. Check error in the console

Expected behavior
No error should be printed.

Screenshots
截屏2024-12-25 15 17 54

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Version 131.0.6778.205
@Kang-Jh
Copy link

Kang-Jh commented Jan 1, 2025

I saw the same error console too when I'm using <Dialog>. But I cannot reproduce it so it might happen rarely? I guess there's some common behavior between dialog and drop down 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants