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

docs: How to maintain state of collapse and expand submenu? #3264

Closed
vishal-ainow opened this issue Nov 6, 2024 · 2 comments
Closed

docs: How to maintain state of collapse and expand submenu? #3264

vishal-ainow opened this issue Nov 6, 2024 · 2 comments

Comments

@vishal-ainow
Copy link

On which page do you see this issue?

https://daisyui.com/components/menu/

Describe the issue

How to maintain state of collapse and expand submenu? in documentation its only <details open> tag. I'm using astro + svelte.

Screenshot 2024-11-07 at 2 50 33 AM

What browsers are you seeing the problem on?

All browsers

Copy link

github-actions bot commented Nov 6, 2024

Thank you @vishal-ainow for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

@saadeghi
Copy link
Owner

saadeghi commented Nov 7, 2024

Here's docs for HTML <details> tag:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details

Adding or removing open attribute opens or closes the menu. This happens automatically with click (no JS needed) But you can add/remove the open attribute using JS if you want to.

Also if you don't want to use <details> tag you can use spans and class names to get the same UI:
https://daisyui.com/components/menu/#collapsible-submenu-that-works-with-class-names

Let me know if you have a question.

@saadeghi saadeghi closed this as completed Nov 7, 2024
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