Skip to content

Commit 2ec32be

Browse files
committed
fix: 🐛 Add aria-describedby to Edit user details button
Since we cannot apply aria-label to an Hds::Button when it has text, we can alternatively apply the aria-describedby attribute instead. Its value must match the id of the form. With that said, a form id value was also added. ✅ Closes: FE-112
1 parent d86805c commit 2ec32be

File tree

3 files changed

+9
-2
lines changed
  • addons
    • core/translations/resources
    • rose/addon/components/rose/form/actions/edit-toggle
  • ui/admin/app/components/form/user

3 files changed

+9
-2
lines changed

addons/core/translations/resources/en-us.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,9 @@ user:
570570
actions:
571571
add-accounts: Add Accounts
572572
delete: Delete User
573-
edit-details: 'Edit User details'
573+
edit-details:
574+
button-text: 'Edit User details'
575+
aria-describedby: 'user-details'
574576
role:
575577
title: Role
576578
title_plural: Roles

addons/rose/addon/components/rose/form/actions/edit-toggle/index.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
{{yield to='edit'}}
99
{{else}}
1010
<Hds::Button
11+
aria-describedby={{@ariaDescribedBy}}
1112
@text={{@enableEditText}}
1213
@color='secondary'
1314
{{on 'click' @enableEdit}}

ui/admin/app/components/form/user/index.hbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
}}
55

66
<Rose::Form
7+
id={{t 'resources.user.actions.edit-details.aria-describedby'}}
78
@onSubmit={{@submit}}
89
@cancel={{@cancel}}
910
@disabled={{@model.isSaving}}
@@ -52,7 +53,10 @@
5253

5354
{{#if (can 'save model' @model)}}
5455
<form.actions
55-
@enableEditText={{t 'resources.user.actions.edit-details'}}
56+
@ariaDescribedBy={{t
57+
'resources.user.actions.edit-details.aria-describedby'
58+
}}
59+
@enableEditText={{t 'resources.user.actions.edit-details.button-text'}}
5660
@submitText={{t 'actions.save'}}
5761
@cancelText={{t 'actions.cancel'}}
5862
/>

0 commit comments

Comments
 (0)