summaryrefslogtreecommitdiff
path: root/web/source/settings/components/username-lozenge.tsx
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-04-09 14:14:20 +0200
committerLibravatar GitHub <noreply@github.com>2025-04-09 14:14:20 +0200
commit19cfa8d126a2ff54298150529e58e5e4f5495f09 (patch)
tree3a569e6c456cc7ea13f16f04c5cd81301b71e5f2 /web/source/settings/components/username-lozenge.tsx
parent[feature] add TOTP two-factor authentication (2FA) (#3960) (diff)
downloadgotosocial-19cfa8d126a2ff54298150529e58e5e4f5495f09.tar.xz
[bugfix] Fix a couple accessibility issues with `:focus` elements (#3979)
* [bugfix/frontend] Fix accessibility/focus issues in settings + web ui * fix little error * tweaks
Diffstat (limited to 'web/source/settings/components/username-lozenge.tsx')
-rw-r--r--web/source/settings/components/username-lozenge.tsx22
1 files changed, 12 insertions, 10 deletions
diff --git a/web/source/settings/components/username-lozenge.tsx b/web/source/settings/components/username-lozenge.tsx
index 9f955cf22..44d627ed3 100644
--- a/web/source/settings/components/username-lozenge.tsx
+++ b/web/source/settings/components/username-lozenge.tsx
@@ -150,19 +150,21 @@ function ReadyUsernameLozenge({ account, linkTo, backLocation, classNames }: Rea
if (linkTo) {
className += " pseudolink";
+ const onClick = () => {
+ // When clicking on an account, direct
+ // to the detail view for that account.
+ setLocation(linkTo, {
+ // Store the back location in history so
+ // the detail view can use it to return to
+ // this page (including query parameters).
+ state: { backLocation: backLocation }
+ });
+ };
return (
<span
className={className}
- onClick={() => {
- // When clicking on an account, direct
- // to the detail view for that account.
- setLocation(linkTo, {
- // Store the back location in history so
- // the detail view can use it to return to
- // this page (including query parameters).
- state: { backLocation: backLocation }
- });
- }}
+ onClick={onClick}
+ onKeyDown={e => e.key === "Enter" && onClick()}
role="link"
tabIndex={0}
>