Collapsing sections doesn't work on mobile

  1. Go to https://meta.discourse.org/c/documentation/using-discourse/126?mobile_view=1
  2. Open the menu
  3. Collapse all the sections
    image
  4. Now, you can’t expand any sections.

The image showcases a Discourse forum page with various discussion topics listed on the left, while the right side displays a series of faq questions including "Understanding post flags in Discourse" and "Creating and managing calendars." (Captioned by AI)

A quick look shows me that it misses a return here:

Also, it seems that no collapsableSections argument is ever passed (could be wrong).
Side-effect of DEV: Convert the entire sidebar to gjs by CvX · Pull Request #26978 · discourse/discourse · GitHub.

2 Likes

@CvX / @saquetim any ideas here?

This issue is also affecting the admin sidebar.

It looks like it has been like this since: UX: Sections not collapsable in "header dropdown" navigation menu by tgxworld · Pull Request #21604 · discourse/discourse · GitHub

The problem is that we’re forcing the sections to be collapsable in mobile view or narrow screens when the navigation menu is set to header dropdown, but we’re not handling the case where it is set to sidebar.

To address the issue, I believe we should force the sections to always be collapsable when in mobile mode or on narrow screens.

The PR below should fix this:

2 Likes