-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Group in sidebar is not expanded for deep nested children #1497
Comments
I've fixed it, finally :) #1540 |
@shigma Is it expected if you expand X manually you will see Y already expanded including Z? Since it's not documented anywhere I don't know if this is a bug or expected. |
I cannot reproduce at your repro. Did you update it? |
Isn't this the default behavior of a sidebar group? |
I've updated the site but the bug should still be visible. If I open this page: frameworks/non-jsx/vue.js.html I'm expecting to see expanded sidebar for the currently active page. So both Frameworks and non-JSX should be expanded. But Frameworks is collapsed.
No, this is not consistent with a non nested sidebar. If there would be no Frameworks group, just non-JSX at top level it would be expanded. And even if that would be not the case, as a user I need to know where the currently active page is located in the sidebar. If the sidebar is collapsed I have no chance to find that out. |
@ulivz let me try to explain with an updated version of this website
Bug 1: I have locally fixed it but it's a dirty hack using a router hook and pure DOM manipulation because I didn't find out where to fix it in VuePress Bug 2: sidebar not expanded active nested items: here is the fix #1540 Bug 3: I have a fix for this as well. Please verify that this is a bug and I will submit my PR |
@timaschew Thank you for addressing this issue! 1. About nested children not being expandedI ran into the same problem. Before noticing your pull request I was already working on a solution myself. Code: coffeephile@6b3bd66 Demo
2. About expanding multiple childrenFurthermore, I have implemented a fix regarding this issue you pointed out.
Code: coffeephile@2303256 Demo (please try expanding both 'Introduction' and 'Documents'): I am not sure if this behavior is desired, but I personally prefer being able to expand multiple children, so I am considering issuing a pull request for this issue. |
Nice, and yes your code looks better ;)
Yes I totally agree. But that can be a configuration, right? So everybody can use its own preferences. I hope the bugs will be fixed soon. I actually expected that they will be fixed before 1.0 will go live, but 1.0 is already out. |
Bug report
Group in sidebar is not expanded for deep nested children.
Version
1.0.0-alpha.44
Steps to reproduce
Open this page: https://hungry-yonath-bfd0a1.netlify.com/frameworks/non-jsx/vue.js.html
The group (Frameworks) in the sidebar is not expanded. You need to expand the first group manually. The second group (non-JSX) is already (correctly) expanded.
repro repo: https://github.com/timaschew/vuepress-nested-sidebar-demo
What is expected?
What is actually happening?
Frameworks is NOT expanded
Other relevant information
I tried to fix the SidebarLinks.vue component by changing this code block:
with a flatten array of all nested children, but it didn't work.
Also I tried to trigger
toggleGroup
withincreated ()
if it matches any nested children for the active route but that has affected the wrong group, it was the inner/second group which was then also collapsed.So please give me a hint then I can provide a PR.
Related documentation:
I didn't saw this documented anywhere, but I just suggest to mention this explicitly in the docs to avoid surprising effects:
The text was updated successfully, but these errors were encountered: