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

RadioButton - value for checked property not changing with radio selection change #16688

Open
ruchitchhabra opened this issue Nov 4, 2024 · 0 comments
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@ruchitchhabra
Copy link

Describe the bug

On selecting the radio button by clicking on label or by keyboard arrow keys, the native checked property of the input[type="radio"] does not get changed. Regardless of the aria-checked state, the assistive technologies recognize the radio button via native checked property.
This relates to #16553. Fixing the checked property should also resolve related issue.

Environment

PrimeNG v17 is being used with Angular v17. The issue also replicable on https://primeng.org/radiobutton.

Reproducer

No response

Angular version

17.3.9

PrimeNG version

17.18.11

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.16.0

Browser(s)

No response

Steps to reproduce the behavior

  1. Select the previously unchecked radio button by clicking on the radio icon.
  2. Observe the value of checked property of the hidden input radio. It is true.
  3. Now select another radio button either by clicking on the label or via keyboard arrow keys.
  4. Observe the value of checked property of the hidden input radio of the newly selected radio button. It is false and value of aria-checked is true. The value of checked property should be true as well. While for the previously selected radio, the value of checked property of hidden input radio is still true and value of aria-checked is false. The value of checked property should change to false.

Expected behavior

On selecting the radio button by clicking on label or by keyboard arrow keys, the native checked property of the input[type="radio"] should get changed. aria-checked attribute is redundant for input[type="radio"] and can be removed.

@ruchitchhabra ruchitchhabra added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 4, 2024
@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 19, 2024
@mertsincan mertsincan added this to the 17.18.13 milestone Nov 19, 2024
@mertsincan mertsincan modified the milestones: 17.18.13, 17.x Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
Status: No status
Development

No branches or pull requests

2 participants