Skip to content

Commit

Permalink
fix(react): ShowPasswordButton should have aria-hidden icon (#4372)
Browse files Browse the repository at this point in the history
* fix(react): ShowPasswordButton should have aria-hidden icon

* Create brown-apricots-add.md

---------

Co-authored-by: Heather Buchel <buchel@amazon.com>
  • Loading branch information
hbuchel and Heather Buchel authored Aug 23, 2023
1 parent 10bae80 commit 265f0b4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-apricots-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aws-amplify/ui-react": patch
---

fix(react): ShowPasswordButton should have aria-hidden="true" on icon
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ exports[`ChangePassword renders as expected 1`] = `
Password is hidden
</span>
<span
aria-hidden="true"
class="amplify-icon"
style="width: 1em; height: 1em;"
>
Expand Down Expand Up @@ -119,6 +120,7 @@ exports[`ChangePassword renders as expected 1`] = `
Password is hidden
</span>
<span
aria-hidden="true"
class="amplify-icon"
style="width: 1em; height: 1em;"
>
Expand Down Expand Up @@ -184,6 +186,7 @@ exports[`ChangePassword renders as expected 1`] = `
Password is hidden
</span>
<span
aria-hidden="true"
class="amplify-icon"
style="width: 1em; height: 1em;"
>
Expand Down Expand Up @@ -271,6 +274,7 @@ exports[`ChangePassword renders as expected with component overrides 1`] = `
Password is hidden
</span>
<span
aria-hidden="true"
class="amplify-icon"
style="width: 1em; height: 1em;"
>
Expand Down Expand Up @@ -336,6 +340,7 @@ exports[`ChangePassword renders as expected with component overrides 1`] = `
Password is hidden
</span>
<span
aria-hidden="true"
class="amplify-icon"
style="width: 1em; height: 1em;"
>
Expand Down Expand Up @@ -401,6 +406,7 @@ exports[`ChangePassword renders as expected with component overrides 1`] = `
Password is hidden
</span>
<span
aria-hidden="true"
class="amplify-icon"
style="width: 1em; height: 1em;"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const ShowPasswordButtonPrimitive: Primitive<

const icon =
fieldType === 'password'
? icons?.visibility ?? <IconVisibility />
: icons?.visibilityOff ?? <IconVisibilityOff />;
? icons?.visibility ?? <IconVisibility aria-hidden="true" />
: icons?.visibilityOff ?? <IconVisibilityOff aria-hidden="true" />;

return (
<Button
Expand Down

0 comments on commit 265f0b4

Please sign in to comment.