Skip to content

NTR: improve checkout payment form accessibility - #1424

Open
cxo-jutz wants to merge 1 commit into
mollie:masterfrom
cxo-jutz:users/ju/ntr/form-accessibility
Open

NTR: improve checkout payment form accessibility#1424
cxo-jutz wants to merge 1 commit into
mollie:masterfrom
cxo-jutz:users/ju/ntr/form-accessibility

Conversation

@cxo-jutz

@cxo-jutz cxo-jutz commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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) and autocomplete="tel" (was off, blocked autofill). The submitted value stays a plain string — type="tel" does no numeric coercion.
  • Removed the non-standard invalid="true" attribute. The error element now has an id, role="alert" (live announcement when shown), and is linked to the input via aria-errormessage, which is exposed once aria-invalid="true" is set.
  • pattern (E.164-style) kept as the HTML5 validation layer.

Phone plugin (phone-plugin.js)

  • Toggles the standard aria-invalid attribute (string value) instead of the invented invalid attribute — this is what activates aria-errormessage and the [aria-invalid] styling hook.

Credit card fields (cc-fields.html.twig)

  • The four <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 via aria-labelledby and is exposed as role="group".
  • The Error containers (populated by Mollie Components) are now role="alert" so component-level errors are announced.

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.

1 participant