Have you checked the console for errors?
sidebar dose not close when i added event listener to close it when i click on and <li> inside it
Hello, I’m having an issue with the sidebar. I added an event listener to close the sidebar on small screens whenever I click any link inside it. The sidebar also has a toggle button. The problem is that when I click a link, the sidebar closes without any issues, but afterward, I have to click the toggle button twice to reopen the sidebar. note i am using the attribues approch for the sidebar , can any one help link to me code https://gist.github.com/mina20088/4b895e3f89e293c6f127503e48a40962
Note : I am using tailwindcss and flowbite
@minaremonshaker The issue was that you were directly calling drawer.hide() when clicking a link, which closes the sidebar visually, but doesn't update Flowbite's internal toggle state.
So when you click the toggle button again, Flowbite thinks the sidebar is still open and does nothing on the first click — then on the second click it works. That's why you’re seeing the "double-click" behavior.
Using toggleButton.click(); keeps Flowbite’s internal state in sync and fixes the issue
I hope this clears it out
Please or to participate in this conversation.