docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.78k stars 5.68k forks source link

activate sidebar on resetEvents #2131

Open andy-held opened 1 year ago

andy-held commented 1 year ago

Summary

When no fetchis done, the active sidebar element is not updated when a link is clicked. This is changed in this commit by calling getAndActive in $resetEvents.

This is shown in the videos below. In both videos, the 'QuickStart' sidebar element was selected, then the 'Initialize' sub-sidebar child of 'Quickstart' and then the parent sidebar element, 'Quickstart' again.

Current behavior

Clicking on a sub-sidebar, then clicking on the parent sidebar again results in no element being 'active' .

Screencast from 14.07.2023 17:51:07.webm

Behavior after fix

Clicking on a sub-sidebar, then clicking on the parent sidebar again results in the sidebar element being 'active' .

Screencast from 14.07.2023 17:50:45.webm

What kind of change does this PR introduce?

Bugfix

Does this PR introduce a breaking change? (check one)

Related issue, if any:

Tested in the following browsers:

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docsify-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 19, 2023 4:03pm