Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fperie opened this issue Feb 6, 2024 · 3 comments
Open
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA Status: Discussion Issue or pull request needs to be discussed by Core Team Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@fperie
Copy link

fperie commented Feb 6, 2024

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.

<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

@fperie fperie added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 6, 2024
@mehmetcetin01140 mehmetcetin01140 added Status: Discussion Issue or pull request needs to be discussed by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 8, 2024
@danielzeliazkow
Copy link

danielzeliazkow commented Feb 9, 2024

[attr.id]="inputId" is now on span element instead of input in dropdown.ts

@cetincakiroglu
Copy link
Contributor

Hi,

Yes we're planning to change this behavior, we'll add a read-only input in the future as accessibility enhancement.

@cetincakiroglu cetincakiroglu added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add Component: Accessibility Issue or pull request is related to WCAG or ARIA labels Feb 12, 2024
@cetincakiroglu cetincakiroglu added this to the 17.Future milestone Feb 12, 2024
@Ivanho92
Copy link

Ivanho92 commented Sep 3, 2024

Any updates on this one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA Status: Discussion Issue or pull request needs to be discussed by Core Team Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
Status: No status
Development

No branches or pull requests

5 participants