feat: accessibility, translations and other improvements#236
Open
jakubjasinsky wants to merge 2 commits intomasterfrom
Open
feat: accessibility, translations and other improvements#236jakubjasinsky wants to merge 2 commits intomasterfrom
jakubjasinsky wants to merge 2 commits intomasterfrom
Conversation
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.
Summary
Dynamic Checkout improvements including WCAG 2.1 AA accessibility enhancements, 4 new locale translations (DE, IT, JA, KO), visible card form labels, custom pay button text support, US billing address fix, single payment method auto-expand behavior, and several bug fixes.
Changes
Accessibility (WCAG 2.1 AA)
role="alert"on card form validation errors and payment error/cancelled views for screen reader announcementsrole="status"on payment success/info/loading viewsrole="radiogroup"witharia-labelon payment method listsaria-labelon icon-only buttons (delete payment method, settings/manage)aria-hidden="true"on decorative spinners,alt=""on decorative imagesid/for/valueattributes on radio inputs and label wrappers for proper associationautocomplete="cc-name"on cardholder name inputaria-labelon billing address inputs and country selectaria-label="Processing payment"(localized) on pay buttons during loading state:focus-visibleoutlines on all interactive elements (radio buttons, pay buttons, delete/settings buttons, form inputs, checkboxes, modal close)@media (prefers-reduced-motion: reduce)to disable spinner animationsNew Locales
delete-payment-method-label,settings-button-label,loading-label,processing-payment-label,card-form-labelCard Form Labels
<label>elements above card number, expiry date, CVC, and cardholder name inputscard-number-label,expiry-date-label,cvc-labellocale keys to all 9 locales.dco-input-labelCSS class for label stylingCustom Pay Button Text
payButtonTextoption toDynamicCheckoutPublicConfigTypeUS Billing Address Fix
["state"]to["street1", "street2", "city", "state", "postcode"]to collect full addressSingle Payment Method Auto-Expand
Bug Fixes
"google-pay-button-container"to"apple-pay-button-container"(copy-paste bug)forattribute to usegateway_nameinstead ofdisplay.name(matching checkbox id)console.log(this.paymentMethod)from saved card payment methodImpact
:focus-visible,prefers-reduced-motion) degrade gracefully in older browsers — no focus indicators shown (same as before), animations continue playingTesting Plan
payButtonText: "Subscribe"in config and verify all pay buttons show custom textpayButtonTextand verify default "Pay {amount} {currency}" behaviorlocaletode,it,ja,koand verify all UI strings are translatedyarn buildand verify clean compilationAdditional Context
<label for>cannot associate across iframe boundaries. Visible labels above the iframes are the best available solution.<h1>-<h6>) since it's embedded in host pages with unknown heading hierarchy. Usesaria-labelonrole="radiogroup"instead.onClosecallback.