Skip to content

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

A11Y: moves anchor rendering out of conditional to prevent losing focus (#17887)

Joffrey JAFFEUX494cc2c69d22
diff --git a/app/assets/javascripts/discourse/app/templates/components/expand-post.hbs b/app/assets/javascripts/discourse/app/templates/components/expand-post.hbs
index 79b9709fb0a..119ffede118 100644
--- a/app/assets/javascripts/discourse/app/templates/components/expand-post.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/expand-post.hbs
@@ -1,11 +1,9 @@
{{#if this.item.truncated}}
- {{#if this.expanded}}
- <a href class="collapse-item" onclick={{action "toggleItem"}} title={{i18n "post.expand_collapse"}}>
+ <a href class={{if this.expanded "collapse-item" "expand-item"}} onclick={{action "toggleItem"}} title={{i18n "post.expand_collapse"}}>
+ {{#if this.expanded}}
{{d-icon "chevron-up"}}
- </a>
- {{else}}
- <a href class="expand-item" onclick={{action "toggleItem"}} title={{i18n "post.expand_collapse"}}>
+ {{else}}
{{d-icon "chevron-down"}}
- </a>
- {{/if}}
+ {{/if}}
+ </a>
{{/if}}