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

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 Nov 2, 2024 7:32pm

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!

@CodeWritingCow
Copy link
Collaborator

Hi @Amberroseweeks, looks like the latest Vercel deployment to its preview env has failed. Can you run lint in your local env and see if any lint error appears? Thanks!

Copy link

This PR has been marked as stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Oct 27, 2024
@bacitracin
Copy link
Collaborator

Hey @Amberroseweeks Just checking in on this PR! Can you please check for failing tests or lint errors locally?

@github-actions github-actions bot removed the stale label Oct 30, 2024
@Amberroseweeks
Copy link
Contributor Author

Hey @Amberroseweeks Just checking in on this PR! Can you please check for failing tests or lint errors locally?

I think I have successfully fixed the issue, I pulled changes from main the combines my changes.

@bacitracin bacitracin merged commit 08addb8 into CodeForPhilly:staging Nov 3, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants