westerveltco / django-simple-nav

A simple, flexible, and extensible navigation menu for Django
https://django-simple-nav.westervelt.dev
MIT License
11 stars 0 forks source link

Active item matching not correct for nested paths #67

Closed joshuadavidthomas closed 2 months ago

joshuadavidthomas commented 5 months ago

I have a nav with two items defined:

If I navigate to the second one, both are marked as active.

image

joshuadavidthomas commented 5 months ago

Also, this app has react client side navigation that does not add a trailing slash. I tend to prefer the trailing slash and use Django's default behavior of adding one, but I'm finding it useful in this app for debugging purposes to differentiate between a client or server side navigation on whether the url has the trailing slash or not. The active property is not applied if the trailing slash is missing:

image

joshuadavidthomas commented 5 months ago

On second thought, the client side navigation may not have anything to do with the active matching. Since the nav is rendered server side any client side navigation doesn't really affect the template since it's already been rendered.