components icon indicating copy to clipboard operation
components copied to clipboard

Accessibility issues with mat-expansion-panel

Open mawabho opened this issue 7 years ago • 3 comments

Hi everybody,

I am currently facing following accessibility issues and I haven't found a solution for them: For example, I have the following template

<span>This is the root</span>
## a lot of stuff before the next span ##
<span>Before expansion panel</span>

<div (click)="expandPanel(0)">
    ## some clickable area to expand the panel ##
</div>
<mat-expansion-panel
    [id]="0-expPanel"
    [expanded]="statusMap[0]">

    <button type="button"
            mat-button
            [attr.aria-controls]="0-expPanel"
            [attr.aria-label]="someLabel"
            (click)="closePanelEmitter.emit()">

</mat-expansion-panel>

<span>After expansion panel</span>
<span>After the expansion panel and span</span>

With this setup, following accessibility issues are occuring:

Device / Screenreader Issue Expected Behavior
Firefox (67.0.4 (64-bit)) / NVDA (2018.4.1) When closing the expansion panel by using the button inside the <mat-expansion-panel>, the screenreader ignores the first element after the <mat-expansion-panel> (in this case the <span>After expansion panel</span> and reads the span after (<span>After the expansion panel and span</span>) When closing the expansion panel by using the button, the screenreader should read the first span after the <mat-expansion-panel>
Samsung Tablet TalkBack / Chrome When closing the expansion panel by using the button inside the <mat-expansion-panel>, the screenreader jumps all the way back to the <span>This is the root</span> Same as above
iPhone VoiceOver / Safari When closing the expansion panel by using the button inside the <mat-expansion-panel>, the screenreader gets stuck reading the [attr.aria-label] from the close button Same as above

Are these already known issues? Are there fixes for them? Thanks in advance!

Marek

mawabho avatar Jul 19 '19 08:07 mawabho

We tested https://stackblitz.com/edit/angular-ognjkq?file=src/app/expansion-overview-example.html on Firefox/NVDA, Android/TalkBack/Chrome, and iPhone/VoiceOver/Safari and all 3 were working as intended. Also the expected behaviour after closing the expansion panel with the button inside the panel should be to focus back on the expansion panel itself not the span after it.

annieyw avatar Oct 30 '20 22:10 annieyw

Closing this since we weren't able to reproduce. Testing on all three platforms, the focus moves back to the expansion panel header on close, which is the expected behavior.

jelbourn avatar Oct 30 '20 22:10 jelbourn

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.