Skip to content

DatePicker: improve accessibility semantics, correct SR announcements and keyboard focus behavior#8513

Open
aligoknl wants to merge 2 commits intoprimefaces:masterfrom
aligoknl:fix/datepicker-enhance-accessibility
Open

DatePicker: improve accessibility semantics, correct SR announcements and keyboard focus behavior#8513
aligoknl wants to merge 2 commits intoprimefaces:masterfrom
aligoknl:fix/datepicker-enhance-accessibility

Conversation

@aligoknl
Copy link
Copy Markdown

This PR improves DatePicker accessibility semantics, screen reader announcement, and keyboard/focus behavior.

What changed

  • Added/updated ARIA semantics for DatePicker triggers (dialog relationship and expanded state).
  • Improved input-icon trigger accessibility parity.
  • Refined keyboard handling for Enter to avoid unnecessary preventDefault.
  • Improved calendar grid focus behavior (gridcell-focused navigation flow).
  • Updated clear action behavior to:
    • clear model value,
    • close overlay,
    • restore focus to input safely without reopening the panel immediately.
  • Correct screen reader announcements

Why

These changes improve screen reader and keyboard UX while preserving existing component behavior as much as possible.

Validation

  • Ran DatePicker unit tests:

    • src/datepicker/DatePicker.spec.js passes.
  • Ran a11y automated tool (used axe DevTools)

    • Before:
Screenshot 2026-03-27 at 1 55 53 PM
  • After:
Screenshot 2026-03-27 at 2 01 34 PM
  • Tested with screen reader (used Voiceover)

Notes

  • Scope intentionally kept narrow to DatePicker behavior/accessibility.
  • No intended functional changes outside DatePicker.

@martijnfleurkens
Copy link
Copy Markdown

Great PR! Since the critical accessibility issues currently in this datepicker primevue component it's breaking users which are using the keyboard and/or screen reader (or any other assistive device). Which makes it a component we currently can not use yet

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