themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.89k stars 742 forks source link

An aria-hidden warning message in console when using sidebar and input together. #946

Open angelofan opened 2 months ago

angelofan commented 2 months ago

Describe the bug When using the sidebar and input simultaneously, some actions will cause aria-hidden warning messages to appear in the console.

image

Blocked aria-hidden on a <input> element because the element that just received 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. 

To Reproduce Steps to reproduce the behavior:

  1. Create an index.html file.
  2. Copy and paste these codes into index.html.
    
    <html>
Demo


3. Open it in a browser.
4. Open the debug console (F12).
5. Switch the interface to mobile mode in the console.
6. Click the "☰" button to show the sidebar.
7. Focus on the input box.
8. Click on the empty area of ​​the sidebar to unfocus it.
9. Click on the gray semi-transparent area outside the sidebar to hide the sidebar.
10. Rotate the device. The sidebar will automatically show up due to the change in the screen breakpoint.
11. Focus on the input box again.
12. The console will show a warning.

Video of steps to reproduce:

https://github.com/user-attachments/assets/ce9c62dd-aafe-4573-a386-5dddc1353f18

**Expected behavior**
The console should remain clean and this warning should not be displayed.

**Screenshots**
![image](https://github.com/user-attachments/assets/affc6b6a-05a7-4f8b-b056-9b92f730af89)

**Additional context**
Some previous description of the problem is at:
- https://github.com/themesberg/flowbite/issues/943#issuecomment-2274967284
- https://github.com/themesberg/flowbite/pull/945#issuecomment-2278151146