How to dismiss the navbar menu on link click and off click? #2492
-
Here is a video of it dismissing on off click nor link click CleanShot.2023-11-12.at.20.15.38.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I am interested in this as well. If you go to the navbar samples and go to the one that has some buttons with dropdown menus, once displayed the menus can be closed only as long as you click on the chevron button. On the other hand if I look at the main components page, and expand the Theme dropdown, that list is discarded as soon as I click somewhere else on the screen. Interestingly enough, in the dropdown samples, in the majority of the samples the dropdown menu is discarded when click somewhere else on the screen. I would appreciate if you can provide some guidance. 🙏 Update: I found this sample: https://daisyui.com/components/dropdown/#dropdown-in-navbar which does work as expected. I guess the only thing left is to include the chevron icon. I will keep looking. Thank you |
Beta Was this translation helpful? Give feedback.
It is explained in dropdown page: https://daisyui.com/components/dropdown/
Method 1: using details and summary tags
Stays open until gets clicked again. Or you can close it using JS by removing the
open
attributeMethod 2: Using CSS focus
Closes when focus is lost