Skip to content

Commit ec836ee

Browse files
committed
hide invisible account button from focus
1 parent d7dd9dd commit ec836ee

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/components/AccountButton/AccountButton.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,19 @@ export default function AccountButton({ ...props }: AccountButtonProps) {
4040
return null;
4141
}
4242

43+
const hiddenButtonProps = !isReadyToShow
44+
? ({
45+
"aria-hidden": true,
46+
tabIndex: -1,
47+
} satisfies Pick<LinkButtonProps, "aria-hidden" | "tabIndex">)
48+
: {};
49+
4350
return user ? (
4451
<FadingAccountButton
4552
href="/profile"
4653
variant="secondary"
4754
{...props}
55+
{...hiddenButtonProps}
4856
$visible={isReadyToShow}
4957
data-testid="account-button-profile"
5058
>
@@ -55,6 +63,7 @@ export default function AccountButton({ ...props }: AccountButtonProps) {
5563
href="/sign-in"
5664
variant="secondary"
5765
{...props}
66+
{...hiddenButtonProps}
5867
$visible={isReadyToShow}
5968
data-testid="account-button-sign-in"
6069
>

0 commit comments

Comments
 (0)