Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

In outlined/animated form styles, telephone fields generate aria-describedby references using the input type (tel) but render error divs using the field type (telephone), breaking assistive tech associations.

Changes

  • Added optional $field_type parameter to render_input_field() that defaults to $type for backward compatibility
  • Updated aria-describedby and error div ID generation to use $field_type instead of $type
  • Updated callers where field type differs from input type: telephone (teltelephone), URL (texturl), date (textdate), and default fields

Example

// Before: aria-describedby="field-123-tel-error-message" but error div was "field-123-telephone-error-message"
$field = $this->render_input_field( 'tel', $id, $value, $class, $placeholder, $required );

// After: both use "telephone" consistently
$field = $this->render_input_field( 'tel', $id, $value, $class, $placeholder, $required, array(), 'telephone' );

This ensures <input type="tel" aria-describedby="field-123-telephone-error-message"> correctly references <div id="field-123-telephone-error-message"> for all form styles.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: enejb <115071+enejb@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on VoiceOver submission fix Forms: Decouple HTML input type from error ID suffix for aria-describedby Jan 23, 2026
Copilot AI requested a review from enejb January 23, 2026 20:01
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.

2 participants