Skip to content

Commit de5eeda

Browse files
committed
sign in: fix keyboard accessibility for all buttons
- Apple sign-in and demo buttons used <a onClick> without href, making them unreachable via Tab key. Added href="#" and role="button" with preventDefault so they're keyboard-focusable. - Added focus-visible outline styling to sign-in buttons so keyboard users can see which button is focused. Fixes #551
1 parent 98b244c commit de5eeda

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/anonymous.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ const styles = () => ({
7979
'&:hover': {
8080
background: '#eee',
8181
},
82+
'&:focus-visible': {
83+
outline: '2px solid #fff',
84+
outlineOffset: 2,
85+
},
8286
},
8387
buttonText: {
8488
fontSize: 18,
@@ -148,7 +152,7 @@ class AnonymousLanding extends Component {
148152
<img className={classes.buttonImage} src={AuthGoogleIcon} alt="" />
149153
<Typography className={classes.buttonText}>Sign in with Google</Typography>
150154
</a>
151-
<a onClick={() => AppleID.auth.signIn()} className={classes.logInButton}>
155+
<a href="#" role="button" onClick={(e) => { e.preventDefault(); AppleID.auth.signIn(); }} className={classes.logInButton}>
152156
<img className={classes.buttonImage} src={AuthAppleIcon} alt="" />
153157
<Typography className={classes.buttonText}>Sign in with Apple</Typography>
154158
</a>

0 commit comments

Comments
 (0)