fix: Improve accessibility for payment form screen reader support#473
Open
naeema-scopes wants to merge 1 commit intosquare:masterfrom
Open
fix: Improve accessibility for payment form screen reader support#473naeema-scopes wants to merge 1 commit intosquare:masterfrom
naeema-scopes wants to merge 1 commit intosquare:masterfrom
Conversation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
zenmasterjobo
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #100
Problem
Users with screen readers (VoiceOver/TalkBack) cannot properly edit payment form fields. The form appears to select fields but focus doesn't actually move, making it impossible to edit values.
Solution
Added proper ARIA attributes across all payment form templates:
role="button",aria-label, andtabindex="0"for keyboard/screen reader accessrole="group"andaria-labelto provide context for the credit card input areaaria-hidden="true"to hide decorative elements from screen readersrole="status"andaria-live="polite"so payment confirmations are announcedrole="alert"andaria-live="assertive"for immediate error announcementsFiles Changed
connect-examples/v2/java_payment/src/main/resources/templates/index.htmlconnect-examples/v2/rails_payment/app/views/welcome/index.html.erbconnect-examples/v2/node_payment/views/index.pugconnect-examples/v2/node_orders-payments/views/checkout/payment.pugTesting
These changes follow WCAG 2.1 AA guidelines and WAI-ARIA best practices.
Note
The card input fields themselves are rendered by Square's Web Payments SDK (
window.payments.card()), so the core focus issue may require SDK-level fixes. However, these template improvements provide better context and navigation for screen reader users.