Describe the bug
In Datepicker, the month (and similarly year) header switch buttons expose an accessible name via aria-label (e.g. “Choose Month”) that does not match the visible button text (e.g. “January”). This creates a label-content-name-mismatch accessibility violation and can break speech-input workflows, because users speak the visible label, not the hidden aria-label.
Pull Request Link
#19582
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/github-c12yaqdu?file=src%2Fapp%2Fapp.component.html
Environment
A library that wraps primeng and provide its own styling.
Angular version
21.0.0
PrimeNG version
v21
Node version
No response
Browser(s)
No response
Steps to reproduce the behavior
- Open a page with PrimeNG p-datepicker in popup/inline mode where the calendar header is visible.
- Open the month selector button in the calendar header (button showing current month text like “January”).
- Inspect the element or run an accessibility scan (axe rule: label-content-name-mismatch).
- Observe the element has aria-label="Choose Month" while visible text is the current month.
- (Optional speech test) Use speech input and say the visible month text (e.g. “January”); the control is not reliably targeted because the accessible name differs.
Expected behavior
The accessible name of the Datepicker header switch buttons should match the visible text content shown to users.
Example: if the button displays “January”, its accessible name should be “January” (not “Choose Month”).
Describe the bug
In Datepicker, the month (and similarly year) header switch buttons expose an accessible name via aria-label (e.g. “Choose Month”) that does not match the visible button text (e.g. “January”). This creates a label-content-name-mismatch accessibility violation and can break speech-input workflows, because users speak the visible label, not the hidden aria-label.
Pull Request Link
#19582
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/github-c12yaqdu?file=src%2Fapp%2Fapp.component.html
Environment
A library that wraps primeng and provide its own styling.
Angular version
21.0.0
PrimeNG version
v21
Node version
No response
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
The accessible name of the Datepicker header switch buttons should match the visible text content shown to users.
Example: if the button displays “January”, its accessible name should be “January” (not “Choose Month”).