# Collapsing sections doesn't work on mobile

**URL:** https://meta.discourse.org/t/collapsing-sections-doesnt-work-on-mobile/352956
**Category:** Bug
**Tags:** fixed, doc-categories
**Created:** [February 18, 2025, 7:04pm UTC](https://meta.discourse.org/t/collapsing-sections-doesnt-work-on-mobile/352956 "2025-02-18T19:04:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [February 18, 2025, 7:04pm UTC](https://meta.discourse.org/t/collapsing-sections-doesnt-work-on-mobile/352956/1 "2025-02-18T19:04:43Z")

</div>

1. Go to [https://meta.discourse.org/c/documentation/using-discourse/126?mobile\_view=1](https://meta.discourse.org/c/documentation/using-discourse/126?mobile_view=1)
2. Open the menu
3. Collapse all the sections  
 ![image](https://global.discourse-cdn.com/meta/original/4X/2/5/f/25fdaf70eb6e2e1ae5b0e1e2ba753729d68268cb.png)
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)](https://global.discourse-cdn.com/meta/original/4X/4/1/f/41f5980c5dd647fd19dd2d1b70b71eba8b560574.gif)

A quick look shows me that it misses a `return` here:  
[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/sidebar/hamburger-dropdown.gjs#L42](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/sidebar/hamburger-dropdown.gjs#L42)

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](https://github.com/discourse/discourse/pull/26978).

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 18, 2025, 11:13pm UTC](https://meta.discourse.org/t/collapsing-sections-doesnt-work-on-mobile/352956/2 "2025-02-18T23:13:24Z")

</div>

@cvx / @saquetim any ideas here?

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [February 19, 2025, 3:26am UTC](https://meta.discourse.org/t/collapsing-sections-doesnt-work-on-mobile/352956/3 "2025-02-19T03:26:16Z")

</div>

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](https://github.com/discourse/discourse/pull/21604)

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:

[https://github.com/discourse/discourse/pull/31383](https://github.com/discourse/discourse/pull/31383)

---

<div class="post-metadata">

### Author: ![saquetim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saquetim/32/116400_2.png) [@saquetim](https://meta.discourse.org/u/saquetim)
#### Post date: [February 21, 2025, 6:30pm UTC](https://meta.discourse.org/t/collapsing-sections-doesnt-work-on-mobile/352956/4 "2025-02-21T18:30:37Z")

</div>


