Skip to content

A platform for community discussion. Free, open, simple.

DEV: Use toggle event for sidebar more-section-links component (#17729)

Alan Guo Xiang Tanc9a3aba5a276
diff --git a/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js b/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js
index a38ccdd4be0..dec9f5dc7a7 100644
--- a/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js
+++ b/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js
@@ -41,8 +41,6 @@ export default class SidebarMoreSectionLinks extends GlimmerComponent {
document
.querySelector(".sidebar-more-section-links-details")
?.removeAttribute("open");
-
- this.toggleSectionLinks();
}
}
}
diff --git a/app/assets/javascripts/discourse/app/templates/components/sidebar/more-section-links.hbs b/app/assets/javascripts/discourse/app/templates/components/sidebar/more-section-links.hbs
index d3f978f997d..c198ae8396e 100644
--- a/app/assets/javascripts/discourse/app/templates/components/sidebar/more-section-links.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/sidebar/more-section-links.hbs
@@ -10,7 +10,7 @@
@model={{this.activeSectionLink.model}} />
{{/if}}
-<details class="sidebar-more-section-links-details" {{on "click" this.toggleSectionLinks}}>
+<details class="sidebar-more-section-links-details" {{on "toggle" this.toggleSectionLinks}}>
<summary class="sidebar-more-section-links-details-summary" >
{{i18n "sidebar.more_count" (hash count=this.sectionLinks.length)}}
</summary>