#14733·primeng

p-dropdown: associate a label with this component (with for="" property)

Author: fperieCreated Feb 6, 2024Updated Sep 21, 2026
LabelsType: EnhancementStatus: DiscussionComponent: Accessibility

Describe the bug

Hello, I tried to set the inputId property of the Dropdown component to associate it with a label using the for attribute. This does not work because the Dropdown component does not have an input field. However, for accessibility purposes, it would be necessary to have a readonly input field. Do you plan to change this behavior?

Environment

PrimeNG 17.5.0

Reproducer

No response

Angular version

17.1.2

PrimeNG version

17.5.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.1

Browser(s)

No response

Steps to reproduce the behavior

If i have a label of dropdown field, its not getting announced with screen reader. Once I choose any option, the label is getting override with selected value and reader reads the field with selected value.

xml
<label for="fieldId"> Field</label>
<p-dropdown [options]="cities" formControlName="
fieldName" aria-required="true" inputId="fieldId"></p-dropdown>

If I click on label, the dropdown field doesn't have the focus.

Expected behavior

No response