Skip to content

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

A11Y: add aria-label to post control buttons (#38553)

Krise86ff2071134
diff --git a/frontend/discourse/app/components/post/menu/buttons/admin.gjs b/frontend/discourse/app/components/post/menu/buttons/admin.gjs
index 9fe8114a038..c7b59540c40 100644
--- a/frontend/discourse/app/components/post/menu/buttons/admin.gjs
+++ b/frontend/discourse/app/components/post/menu/buttons/admin.gjs
@@ -20,6 +20,7 @@ export default class PostMenuAdminButton extends Component {
@icon="wrench"
@label={{if @showLabel "post.controls.admin_action"}}
@title="post.controls.admin"
+ @ariaLabel="post.controls.admin"
/>
</template>
}
diff --git a/frontend/discourse/app/components/post/menu/buttons/copy-link.gjs b/frontend/discourse/app/components/post/menu/buttons/copy-link.gjs
index 85f3c0bc373..b2d96b3c8be 100644
--- a/frontend/discourse/app/components/post/menu/buttons/copy-link.gjs
+++ b/frontend/discourse/app/components/post/menu/buttons/copy-link.gjs
@@ -8,6 +8,7 @@ const PostMenuCopyLinkButton = <template>
@icon="d-post-share"
@label={{if @showLabel "post.controls.copy_action"}}
@title="post.controls.copy_title"
+ @ariaLabel="post.controls.copy_title"
/>
</template>;
diff --git a/frontend/discourse/app/components/post/menu/buttons/delete.gjs b/frontend/discourse/app/components/post/menu/buttons/delete.gjs
index 5f434aeff3c..8318cee3b74 100644
--- a/frontend/discourse/app/components/post/menu/buttons/delete.gjs
+++ b/frontend/discourse/app/components/post/menu/buttons/delete.gjs
@@ -128,6 +128,7 @@ export default class PostMenuDeleteButton extends Component {
@icon={{this.icon}}
@label={{if @showLabel this.label}}
@title={{this.title}}
+ @ariaLabel={{this.title}}
/>
</template>
}
diff --git a/frontend/discourse/app/components/post/menu/buttons/edit.gjs b/frontend/discourse/app/components/post/menu/buttons/edit.gjs
index 6bc97dd2a0e..71ad722cb8f 100644
--- a/frontend/discourse/app/components/post/menu/buttons/edit.gjs
+++ b/frontend/discourse/app/components/post/menu/buttons/edit.gjs
@@ -38,6 +38,7 @@ export default class PostMenuEditButton extends Component {
@icon={{if @post.wiki "far-pen-to-square" "pencil"}}
@label={{if this.showLabel "post.controls.edit_action"}}
@title="post.controls.edit"
+ @ariaLabel="post.controls.edit"
/>
</template>
}
diff --git a/frontend/discourse/app/components/post/menu/buttons/flag.gjs b/frontend/discourse/app/components/post/menu/buttons/flag.gjs
index 27e4a413670..7e67bae6640 100644
--- a/frontend/discourse/app/components/post/menu/buttons/flag.gjs
+++ b/frontend/discourse/app/components/post/menu/buttons/flag.gjs
@@ -67,6 +67,7 @@ export default class PostMenuFlagButton extends Component {
@icon="flag"
@label={{if @showLabel "post.controls.flag_action"}}
@title={{this.title}}
+ @ariaLabel={{this.title}}
@disabled={{this.isFlagButtonDisabled}}
/>
</div>
diff --git a/frontend/discourse/app/components/post/menu/buttons/like.gjs b/frontend/discourse/app/components/post/menu/buttons/like.gjs
index 3c233e04870..3f233eb90a1 100644
--- a/frontend/discourse/app/components/post/menu/buttons/like.gjs
+++ b/frontend/discourse/app/components/post/menu/buttons/like.gjs
@@ -85,6 +85,7 @@ export default class PostMenuLikeButton extends Component {
@icon={{this.likeButtonIcon}}
@label={{if @showLabel "post.controls.like_action"}}
@title={{this.title}}
+ @ariaLabel={{this.title}}
/>
</div>
{{else}}
diff --git a/frontend/discourse/app/components/post/menu/buttons/share.gjs b/frontend/discourse/app/components/post/menu/buttons/share.gjs
index b958c566b9c..daa6dbe6892 100644
--- a/frontend/discourse/app/components/post/menu/buttons/share.gjs
+++ b/frontend/discourse/app/components/post/menu/buttons/share.gjs
@@ -8,6 +8,7 @@ const PostMenuShareButton = <template>
@icon="d-post-share"
@label={{if @showLabel "post.controls.share_action"}}
@title="post.controls.share"
+ @ariaLabel="post.controls.share"
/>
</template>;
diff --git a/frontend/discourse/app/components/post/menu/buttons/show-more.gjs b/frontend/discourse/app/components/post/menu/buttons/show-more.gjs
index 0fb6c4476e6..99c384b3272 100644
--- a/frontend/discourse/app/components/post/menu/buttons/show-more.gjs
+++ b/frontend/discourse/app/components/post/menu/buttons/show-more.gjs
@@ -13,6 +13,7 @@ export default class PostMenuShowMoreButton extends Component {
@action={{@buttonActions.showMoreActions}}
@icon="ellipsis"
@title="show_more"
+ @ariaLabel="show_more"
/>
</template>
}