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

VPMenuLink does not handle regex for activeMatch #1771

Closed
3 tasks done
peterhpchen opened this issue Jan 7, 2023 · 0 comments
Closed
3 tasks done

VPMenuLink does not handle regex for activeMatch #1771

peterhpchen opened this issue Jan 7, 2023 · 0 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@peterhpchen
Copy link

peterhpchen commented Jan 7, 2023

Describe the bug

VPMenuLink does not handle regex for activeMatch.

Reproduction

Please see this StackBlitz:

  1. Click Dropdown Menu > Item A. The Item A of the Dropdown Menu is active.
  2. Click Next Page to go to second page. The Item A of the Dropdown Menu is inactive.the

Expected behavior

The Item A in the Nav should be active on both pages.

System Info

System:
    OS: macOS 13.0.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 26.19 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.0 - ~/.config/nvm/versions/node/v18.12.0/bin/node
    Yarn: 1.22.19 - ~/.config/nvm/versions/node/v18.12.0/bin/yarn
    npm: 8.19.2 - ~/.config/nvm/versions/node/v18.12.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.124
    Safari: 16.1
  npmPackages:
    vitepress: ^1.0.0-alpha.35 => 1.0.0-alpha.35 

Additional context

I think we should add the third parameter to the function isActive in the component VPMenuLink because it handles the regex.

:class="{ active: isActive(page.relativePath, item.activeMatch || item.link) }"

Just like VPNavBarMenuGroup:

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@peterhpchen peterhpchen added the bug: pending triage Maybe a bug, waiting for confirmation label Jan 7, 2023
@brc-dd brc-dd closed this as completed in 0913e0f Jan 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

1 participant