NTR: improve checkout payment form accessibility - #1424
Open
cxo-jutz wants to merge 1 commit into
Open
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.
Brings the Mollie phone and credit card payment fields in line with our form conventions (native HTML5 semantics as the first layer, ARIA for state and announcements). Storefront templates + phone plugin only — no logic or API changes.
Phone field (phone-fields.html.twig)
type="text"→type="tel"+inputmode="tel"(correct mobile keyboard) andautocomplete="tel"(was off, blocked autofill). The submitted value stays a plain string —type="tel"does no numeric coercion.invalid="true"attribute. The error element now has an id,role="alert"(live announcement when shown), and is linked to the input viaaria-errormessage, which is exposed oncearia-invalid="true"is set.pattern(E.164-style) kept as the HTML5 validation layer.Phone plugin (phone-plugin.js)
aria-invalidattribute (string value) instead of the invented invalid attribute — this is what activatesaria-errormessageand the[aria-invalid]styling hook.Credit card fields (cc-fields.html.twig)
<label for="…">pointed at<div>iframe mount containers, which is ignored by assistive tech. Labels now carry an id, and each mount container references it viaaria-labelledbyand is exposed asrole="group".role="alert"so component-level errors are announced.