Fix: Restore keyboard accessibility in donation amount template #7652
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 applyingdisplay: none
to theinput[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
Testing Instructions
shift
+tab
to access the group in a backward fashion once you have progressed past it.Pre-review Checklist