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

Fix: Restore keyboard accessibility in donation amount template #7652

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

JoshuaHungDinh
Copy link
Contributor

@JoshuaHungDinh JoshuaHungDinh commented Dec 19, 2024

Resolves: GIVE-2072

Reference: https://lw.slack.com/archives/C02Q714965S/p1734472242800619

Description

This PR restores the native keyboard access to the radio field for the donation frequency.

Previous Implementation:
The Amount stylesheet was applying display: none to the input[type='radio'] because we have a custom radio button UI for Donation Frequencies in v3 forms. However, this approach inadvertently removed native keyboard accessibility.

Solution:
To restore keyboard accessibility, I’ve updated the implementation to keep the radio button in the DOM while visually hiding it from the HTML flow by positioning it below the form's z-index, allowing it to remain focusable and operable via the keyboard.

Additional styles were included to better match the focus elements of the Donation Levels & Custom Amount with the rest of the form inputs.

References:

Affects

v3 forms - Radio Fields - Donation Frequency - Donation Amount Template

Visuals

https://www.loom.com/share/59e3083c67e549808157eedb4af146e5?sid=86f5e996-aac0-441a-afd2-08517fe0fbb1

focus-visible

Testing Instructions

  • Create a v3 form with recurring donations.
  • Use the Tab key to select the Donation Frequency group.
  • Once the group is selected you should be able to use all the arrow keys to navigate the group.
  • Pressing Tab again will take you to the next field.
  • You should be able to press shift + tab to access the group in a backward fashion once you have progressed past it.
  • Tab through the donation levels

Pre-review Checklist

  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@JoshuaHungDinh JoshuaHungDinh changed the base branch from develop to master December 19, 2024 09:00
@JoshuaHungDinh JoshuaHungDinh marked this pull request as ready for review December 19, 2024 12:06
Copy link
Contributor

@jdghinson jdghinson left a comment

Choose a reason for hiding this comment

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

All good!

@JoshuaHungDinh JoshuaHungDinh changed the base branch from master to develop January 6, 2025 05:30
@JoshuaHungDinh JoshuaHungDinh changed the title Fix: Improve keyboard accessibility for donation amount template Fix: Restore keyboard accessibility for donation amount template Jan 6, 2025
@JoshuaHungDinh JoshuaHungDinh changed the title Fix: Restore keyboard accessibility for donation amount template Fix: Restore keyboard accessibility in donation amount template Jan 6, 2025
@glaubersilva glaubersilva self-requested a review January 6, 2025 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants