Skip to content

Conversation

@MaryamMehd
Copy link
Collaborator

… choice dropdown fields

  • Remove multiline prop from Choice Select fields to render as proper single-line combobox
  • Add aria-labelledby to link field labels for proper VoiceOver announcement
  • Use aria-label fallback for tabled fields without visible labels

This ensures VoiceOver announces the field name (e.g., 'Smoking status, combo box') and enables standard keyboard navigation (Tab to focus, Arrow keys to navigate options, Enter to select, Escape to close).

Fixes #1762

… choice dropdown fields

- Remove multiline prop from Choice Select fields to render as proper single-line combobox
- Add aria-labelledby to link field labels for proper VoiceOver announcement
- Use aria-label fallback for tabled fields without visible labels

This ensures VoiceOver announces the field name (e.g., 'Smoking status, combo box')
and enables standard keyboard navigation (Tab to focus, Arrow keys to navigate options,
Enter to select, Escape to close).

Fixes #1762
After removing multiline prop from Select fields, the component now renders as <input> instead of <textarea>. Updated test to query for 'input' element to match the new rendering.
@MaryamMehd MaryamMehd requested a review from janadh November 6, 2025 06:01
@MaryamMehd MaryamMehd self-assigned this Nov 6, 2025
Add openOnFocus prop to MUI Autocomplete components for Select choice fields.
This enables the dropdown to open automatically when the field receives Tab focus,
allowing full keyboard-only navigation without requiring mouse interaction.

- Tab to field → dropdown opens automatically
- Arrow keys → navigate options
- Enter → select option
- Escape → close dropdown
- Explicitly set role='combobox' on input element to ensure entire dropdown component (text input + arrow) is recognized as one unit
- Removes 'openOnFocus' to prevent automatic dropdown opening that interferes with VoiceOver field name announcement
- Maintains aria-labelledby for proper field name announcement

This ensures VoiceOver announces 'Smoking status, combo box' and provides proper keyboard navigation instructions to users.

Fixes #1762
@MaryamMehd MaryamMehd requested a review from clinnygee November 19, 2025 03:15
Copy link
Collaborator

@clinnygee clinnygee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @MaryamMehd

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.

Combobox dropdown menu, keyboard-only navigation

4 participants