Skip to content

Commit 0e7aa98

Browse files
author
Otsmane-Ahmed
committed
fix: add ARIA attributes to admin notices dropdown for accessibility
- Added role='button', aria-haspopup='true', aria-expanded='false', and aria-label to dropdown button - Added role='menu' to menu container - Added role='menuitem' to all menu items (select all, deselect all, inverse selection) - Follows WCAG 2.1 Level A accessibility guidelines - Resolves TODO comment at line 40 This change makes the operations dropdown accessible to screen reader users, allowing them to properly interact with the admin notices bulk actions.
1 parent ebd88af commit 0e7aa98

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

templates/admin/notice.tmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@
3737
{{.CsrfTokenHtml}}
3838
<button type="submit" class="ui red small button">{{ctx.Locale.Tr "admin.notices.delete_all"}}</button>
3939
</form>
40-
<div class="ui floating upward dropdown small button">{{/* TODO: Make this dropdown accessible */}}
40+
<div class="ui floating upward dropdown small button" role="button" aria-haspopup="true" aria-expanded="false" aria-label="{{ctx.Locale.Tr "admin.notices.operations"}}">
4141
<span class="text">{{ctx.Locale.Tr "admin.notices.operations"}}</span>
42-
<div class="menu">
43-
<div class="item select action" data-action="select-all">
42+
<div class="menu" role="menu">
43+
<div class="item select action" role="menuitem" data-action="select-all">
4444
{{ctx.Locale.Tr "admin.notices.select_all"}}
4545
</div>
46-
<div class="item select action" data-action="deselect-all">
46+
<div class="item select action" role="menuitem" data-action="deselect-all">
4747
{{ctx.Locale.Tr "admin.notices.deselect_all"}}
4848
</div>
49-
<div class="item select action" data-action="inverse">
49+
<div class="item select action" role="menuitem" data-action="inverse">
5050
{{ctx.Locale.Tr "admin.notices.inverse_selection"}}
5151
</div>
5252
</div>

0 commit comments

Comments
 (0)