robsontenorio / mary

Laravel Blade UI Components for Livewire 3
https://mary-ui.com
Other
804 stars 88 forks source link

When I use sidebar and use sub-menu , if I click on a sub menu item it closes the sub menu instead of the maintaining the state #481

Closed shadmanshaikh closed 2 weeks ago

shadmanshaikh commented 3 weeks ago

maryUI version

1.26

daisyUI version

4.10.1

Livewire version

3.4

What browsers are affected?

Chrome

What happened?

In app.blade

I have sub-menu and its sub-menu-item , when I click on the sub-menu it closes instead of being in the same state

this is a standard code used by me from the MaryUI docs: `

`

bestmomo commented 3 weeks ago

Read this doc item. There are two ways to activate menu:

  1. use active attribute
  2. use activate-by-route attribute (your routes must match in this case)
shadmanshaikh commented 3 weeks ago

active attribute does work for x-menu-sub , if i use for x-menu-item it show's the sub menu item by default its active , I just to open a dropdown and when clicked it should go to the link and should not close the dropdown

robsontenorio commented 3 weeks ago

If you are using it on Dropdowns see this

https://mary-ui.com/docs/components/dropdown#click-propagation

shadmanshaikh commented 3 weeks ago

I'm using <x-menu-sub>

shadmanshaikh commented 3 weeks ago

this is my original code :

`

                    <x-menu-item title="Task Assigned" icon="o-clipboard-document-check" link="task-assigned" /> </x-menu-sub>    </x-menu>`
robsontenorio commented 2 weeks ago

Please, read carefully the Menu docs, about the correct usage of the link="...".

https://mary-ui.com/docs/components/menu