Skip to content

ContentNavigation issue with default-open and same route prefix #5112

@ukena

Description

@ukena

Environment

Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.x

Version

v4.0.0

Reproduction

I think the issue is pretty obvious. It is a very small edge-case that can be solved easily.

Description

The route.path.startsWith(link.path) in ContentNavigation leads to issues with default-open if the route has the same prefix.
E.g. if you would open /docs-old but /docs also exists, then /docs is opened on the ContentNavigation instead of /docs-old.
I guess this should be easily fixable by comparing the whole path instead of relying on startsWith.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting initial review and prioritizationv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions