1

I am using radio button group in my application and it has 3 possible values. Whenever user is selecting a value, screen reader is reading "1 of 1" instead of "1 of 3".

I also checked the behavior on Angular website and it's behaving same.

Sample code : Stackblitz

Browser: Microsoft Edge Screen reader: Narrator

7
  • when i view the generated html from your stackblitz example, the two radio buttons have the same name attribute ("mat-radio-group-0"), which is the correct way to group the buttons together. nvda on chrome says "1 of 2" and "2 of 2" so it seems like the correct information is being surfaced (in my setup). have you tried narrator with firefox or chrome? Commented Mar 28, 2019 at 2:17
  • @slugolicious - thanks for your response. Is it working for you in Edge + Narrator? Commented Mar 28, 2019 at 19:13
  • 1
    i don't have w10 so i don't have edge Commented Mar 29, 2019 at 5:26
  • @slugolicious - aahhh.. where can I report this bug? Angular or Edge? Commented Mar 31, 2019 at 19:17
  • @alok_dida Did you ever get this resolved? I'm having the exact same issue. Commented Aug 13, 2021 at 13:38

2 Answers 2

0

.html

<label id="example-radio-group-label">Pick your favorite season</label>
<mat-radio-group
  aria-labelledby="example-radio-group-label"
  class="example-radio-group"
  [(ngModel)]="favoriteSeason">
  <mat-radio-button class="example-radio-button" *ngFor="let season of seasons" [value]="season">
    {{season}}
  </mat-radio-button>
</mat-radio-group>
<div>Your favorite season is: {{favoriteSeason}}</div>

.ts

import {Component} from '@angular/core';

/**
 * @title Radios with ngModel
 */
@Component({
  selector: 'radio-ng-model-example',
  templateUrl: 'radio-ng-model-example.html',
  styleUrls: ['radio-ng-model-example.css'],
})
export class RadioNgModelExample {
  favoriteSeason: string;
  seasons: string[] = ['Winter', 'Spring', 'Summer', 'Autumn'];
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your response. Looks like, you have understood question in wrong way. I am facing issue with screen reader. When you are selecting Winter, narrator should read 1 of 4 instead of 1 of 1
0

It seems that you want to display the checked value, try to refer to the following code and use Model to get the checked value.

<mat-radio-group [(ngModel)]="rdoSeason" aria-label="Select an option">
  <mat-radio-button [value]="1">Option 1</mat-radio-button>
  <mat-radio-button [value]="2">Option 2</mat-radio-button>
  <mat-radio-button [value]="3">Option 3</mat-radio-button>
</mat-radio-group>
<div>You select Option: {{rdoSeason}}</div>

Code in the .ts file:

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-material-radiobutton',
  templateUrl: './material-radiobutton.component.html',
  styleUrls: ['./material-radiobutton.component.css']
})
export class MaterialRadiobuttonComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }
  rdoSeason:string;
}

the result as below:

enter image description here

More details about using the radio-button label, check this article.

1 Comment

Looks like, you have understood question in wrong way. I am facing issue with screen reader. When you are selecting option1 , narrator should read 1 of 3 instead of 1 of 1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.