kobalte icon indicating copy to clipboard operation
kobalte copied to clipboard

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

Open JohnCido opened this issue 1 year ago • 5 comments

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

JohnCido avatar Dec 25 '24 07:12 JohnCido

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 🤔

Kang-Jh avatar Jan 01 '25 03:01 Kang-Jh

Yes, I am experiencing the same problem so I can +1 on this issue!

wontheone1 avatar Jan 30 '25 09:01 wontheone1

Same problem with <Dialog>

Azq2 avatar Feb 26 '25 08:02 Azq2

+1 with <Dialog>.

axelra82 avatar Mar 22 '25 15:03 axelra82

+1 with <Select>.

Bravilogy avatar Apr 13 '25 16:04 Bravilogy