app-generator / django-datta-able

Datta Able - Open-Source Django Dashboard | AppSeed
https://appseed.us/product/datta-able/django/
Other
535 stars 236 forks source link

Disabling a menu option #23

Closed BaktashGorgani closed 1 year ago

BaktashGorgani commented 1 year ago

If you add the "disabled" class to a menu option list item it will have the disabled look, however, it can still be "active" and the link still works if clicked.

If you add the "disabled" class to the anchor tag within the list item instead, there is an unintended consequence where if you click on the disabled menu twice, the currently active menu dissapears from the menu list.

Also, I would like to know which method should be used, adding disabled to the list item tag or to the anchor tag.

Thank You!

ct-viral commented 1 year ago

Hello @BaktashGorgani ,

put below given line of code in your custom CSS files, for disabled link

.pcoded-navbar .pcoded-inner-navbar li.disabled,
.pcoded-navbar .pcoded-inner-navbar li.disabled > a{
    pointer-events: none;
    cursor: not-allowed;
}

Thanks.

BaktashGorgani commented 1 year ago

Worked like a charm. Thank You!

app-generator commented 1 year ago

Ty @ct-viral