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

sidebar item closes when it should stay open #2752

Closed
4 tasks done
jeremyriverain opened this issue Aug 8, 2023 · 3 comments · Fixed by #2753
Closed
4 tasks done

sidebar item closes when it should stay open #2752

jeremyriverain opened this issue Aug 8, 2023 · 3 comments · Fixed by #2753
Labels
bug Something isn't working theme Related to the theme

Comments

@jeremyriverain
Copy link
Contributor

Describe the bug

When I navigate on my application after the initial load and I click on a sidebar item that is collapsed, it collapses the sidebar item again.

Reproduction

I reproduced the problem on Stackblitz: https://stackblitz.com/edit/vite-smcwhn?file=docs%2Fitem-2.md

Peek 08-08-2023 14-02

The steps to reproduce are the following:

  1. Click on "Get Started" link
  2. Open the Sidebar
  3. Click on "Dropdown menu", then on "Item 1"
  4. You are on the "item 1" page. Open the sidebar again. We remark the "Dropdown menu" is collapsed, although I'm on the "item 1" page

The problem appears only during SPA navigation. If I reload completely the page "Item 1", the "Dropdown Menu" inside the sidebar is open as expected.

Expected behavior

In that scenario, the sidebar item should remain open to give more context to the user.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (6) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.20.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.6.10 - /usr/local/bin/pnpm
  npmPackages:
    vitepress: latest => 1.0.0-rc.1

Additional context

No response

Validations

@jeremyriverain jeremyriverain added the bug: pending triage Maybe a bug, waiting for confirmation label Aug 8, 2023
@brc-dd brc-dd added bug Something isn't working theme Related to the theme and removed bug: pending triage Maybe a bug, waiting for confirmation labels Aug 8, 2023
@brc-dd brc-dd closed this as completed in 2fe8f60 Aug 8, 2023
@brc-dd
Copy link
Member

brc-dd commented Aug 8, 2023

try with rc.2

@jeremyriverain
Copy link
Contributor Author

Thanks for working on the bug. It solves the problem on Stackblitz.

That said, on my real project, the bug is partially solved. The project uses multiple sidebars and this seems to be the problem.

I modified my Stackblitz example to show the problem: https://stackblitz.com/edit/vite-smcwhn?file=docs%2F.vitepress%2Fconfig.ts

Peek 08-08-2023 16-14

@jeremyriverain
Copy link
Contributor Author

I tried with rc.3. It works fine. Thanks a lot !

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working theme Related to the theme
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants