Skip to content

On mobile, the Sidebar remains open when a page with no sub-topics is tapped. #2556

Closed
@paulhibbitts

Description

@paulhibbitts

Bug Report

Steps to reproduce

  1. View the site https://hibbitts-design.github.io/docsify-template-v5/#/ on mobile
  2. Open the sidebar
  3. Tap on ReadMe to view page sub-topics (as expected)
  4. Tap on a ReadMe sub-topic to view that sub-topic on page (as expected)
  5. Open the sidebar
  6. Tap on Second Page (with no sub-topics), and while the page is navigated to the Sidebar remains open (not expected, as shown below)

Image

Here is an additional Docsify v5 rc-1 example (tap on Topic One and Topic two when on mobile):
https://hibbitts-design.github.io/preview-docsify-open-publishing-starter-kit-v2-docsify-v5

And the issue also is evident when mergeNavbar is used (tap on Sidebar to view merged Navbar items when on mobile):
https://hibbitts-design.github.io/preview-docsify-open-course-starter-kit-v2-docsify-v5/

Current behaviour

  1. View Docsify v5 site
  2. Open the sidebar
  3. Tap on page with sub-topics, page is shown with sidebar open and sub-topics are then visible
  4. Tap on a sub-topic and that sub-topic is navigated to and sidebar is closed
  5. Open the sidebar
  6. Tap on a page with no sub-topics, and while the page is shown to Sidebar remains open

Expected behaviour

  1. View Docsify v5 site
  2. Open the sidebar
  3. Tap on ReadMe to show page and view page sub-topics (sidebar remains open)
  4. Tap on a ReadMe sub-topic to view that sub-top on page
  5. Open the sidebar
  6. Tap on Second Page (with no sub-topics) the page is displayed and the sidebar should close

Other relevant information

  • Docsify version:
    Docsify v5 rc-1
  • Bug still occurs when all/other plugins are disabled?

  • Docsify plugins (if the bug happens when plugins enabled, please try to isolate the issue):

Please create a reproducible sandbox

Here is a sample on Codebox:
https://codesandbox.io/p/sandbox/docsify-v5-sidebar-nav-ljxvyd

Mention the docsify version in which this bug was not present (if any)

Please let me know if any additional info/testing is helpful, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    v5-rcv5 rc version related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions