Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding focus and keyboard accessibility to the cookie consent buttons #945

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

Amberroseweeks
Copy link
Contributor

@Amberroseweeks Amberroseweeks commented Oct 9, 2024

  • You can now tab to the cookie options when they appear and when you select the button in the footer
  • You can activate the cookie settings by pressing ENTER or SPACEBAR on the button in the footer
  • The cookie setting are working for me on Apple VO, I have applied aria-describedby on the div and added the role of region.

Note: I added positive tab values for the Accept and Decline buttons. This feels a little wrong, I am not sure if this is best practice, but it did seem to work in allowing those items to receive focus first.

This closes issue #859

Copy link

vercel bot commented Oct 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vacant-lots-proj ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2024 6:50pm

color="tertiary"
label="Decline"
startContent={<X />}
onPress={() => onClickButton(false)}
/>

<ThemeButton
tabIndex={2}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of those exceptions to the rule that I think is okay.
Although I have seen it said somewhere on the A11y Slack channel that by now screenreader users just expect that the cookie banner will be on the bottom and they will TAB backwards to get to it.

@@ -3,12 +3,15 @@
import { ThemeButton } from "./ThemeButton";
import { Check, X } from "@phosphor-icons/react";
import { useCookieContext } from "@/context/CookieContext";
import { useEffect, useState } from "react";
import { useEffect, useState, useRef } from "react";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you have a couple of small conflicts that need to be resolved with main.

Copy link
Collaborator

@bacitracin bacitracin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! You just need to fix your conflicts

@CodeWritingCow CodeWritingCow changed the base branch from main to staging October 14, 2024 03:34
@CodeWritingCow
Copy link
Collaborator

Hi @Amberroseweeks I've changed the PR target branch from main to staging. In the future, let's submit PRs against main branch. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants