ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: Accessibility issue: Backdrop in ion-popover component has invalid aria-hidden value

Open annamelnyk opened this issue 1 year ago • 28 comments
trafficstars

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

Backdrop (shadow part of ion-popover component) contains attribute aria-hidden=true, which is not correct from accessibility purposes. Console shows error below: Blocked aria-hidden on a <ion-backdrop> element because the element that just received focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at

Expected Behavior

Backdrop (shadow part of ion-popover component) NOT contains attribute aria-hidden

Steps to Reproduce

  1. Open the element
  2. Click on backdrop
  3. Popover will be dismissed and console error will appear

Code Reproduction URL

https://stackblitz.com/edit/angular-e2jj3l-tpkxhe?file=src%2Fapp%2Fapp.component.html

Ionic Info

Ionic:

Ionic CLI : 7.1.1 Ionic Framework : @ionic/angular 7.5.5 @angular-devkit/build-angular : 16.0.6 @angular-devkit/schematics : 16.0.6 @angular/cli : 16.0.6 @ionic/angular-toolkit : 9.0.0

Capacitor: Capacitor CLI : 5.0.5 @capacitor/android : 5.0.5 @capacitor/core : 5.0.5 @capacitor/ios : 5.0.5

Utility: cordova-res : not installed globally native-run : 1.7.4

System: NodeJS : v20.13.1 npm : 10.5.2 OS : Windows 10

Additional Information

No response

annamelnyk avatar Aug 15 '24 03:08 annamelnyk

I am not able to see any sort of warning or error in my console when I click the backdrop. I am using the issue reproduction url you sent.

dev-charles15531 avatar Aug 15 '24 18:08 dev-charles15531

@dev-charles15531 thank you for quick reply. To see the error open console in browser devTools, not in Stackblitz.

I did cross browser testing on Windows 11:

  • Chrome v127 - shows error
  • Edge v127 - shows error
  • Mozilla v129 - does not show error

annamelnyk avatar Aug 16 '24 02:08 annamelnyk

is this resolved ?

boluwatifee4 avatar Aug 16 '24 06:08 boluwatifee4

Bump, its so annoying while debugging. Please fix it! Seeing it on chrome when closing modal as well.

wiktor-wrzaszcz avatar Aug 20 '24 12:08 wiktor-wrzaszcz

Hi ionic-team, is there any updates regarding current issue? Thanks in advance!

annamelnyk avatar Aug 21 '24 03:08 annamelnyk

Hi Team, We are using ionic 8.2.7 core and angular 18.2.0. Our team also facing the same issue while opening modal controller and clicking outside to close (backdrop close).

Please refer the below error.

Blocked aria-hidden on a element because the element that just received focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.

<ion-backdrop part=​"backdrop" tabindex=​"-1" aria-hidden=​"true" class=​"ios" style>​#shadow-root (open)</ion-backdrop>​ image

maniya108 avatar Aug 21 '24 07:08 maniya108

Hi, i have the same problem is there any fixes or updates ?

D3rDicke avatar Aug 21 '24 18:08 D3rDicke

Hi, i have the same problem is there any fixes or updates ?

ingbioservicios avatar Aug 23 '24 12:08 ingbioservicios

"@ionic/vue": "7.8.6", "nuxt": "3.13.0" Same issue

vityapro avatar Aug 23 '24 13:08 vityapro

I have the same problem. Hope it would get fixed soon, thanks!

dangduoc avatar Aug 24 '24 10:08 dangduoc

Same here! Would really appreciate if they could solve this, it's highly frustrating.

KeyTurns avatar Aug 24 '24 13:08 KeyTurns

Same for me

Sagie501 avatar Aug 25 '24 10:08 Sagie501

Same

m345054 avatar Aug 25 '24 20:08 m345054

Ditto

doogie99 avatar Aug 26 '24 19:08 doogie99

Same for me

soroush-gh avatar Aug 27 '24 13:08 soroush-gh

Same

wrodriguezmethodo avatar Aug 29 '24 22:08 wrodriguezmethodo

Bump

ibilux avatar Aug 30 '24 07:08 ibilux

+1

tbence94 avatar Aug 30 '24 23:08 tbence94

I am not able to see any sort of warning or error in my console when I click the backdrop. I am using the issue reproduction url you sent.

You need to use this version of Chrome Version 128.0.6613.85 (Official Build) (64-bit)

rajibhasan11 avatar Sep 02 '24 04:09 rajibhasan11

Same here I am using ionic 5 / angular 13.

Blocked aria-hidden on a element because the element that just received focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.

rajibhasan11 avatar Sep 02 '24 04:09 rajibhasan11

Same here Ionic 6 / Angular 15

fabichacon avatar Sep 02 '24 14:09 fabichacon

Same here. Using latest version of Ionic React.

jackhipson300 avatar Sep 03 '24 21:09 jackhipson300

Not sure if this helps or makes things more confusing, but I'm using Ionic React 8.2.7 and Chrome 128.0.6613.120 on a Windows 10 machine, and I'm seeing the error as well. However, it seems to be intermittent; refreshing the page often makes the error stop appearing. I was able to get it to reappear once by clearing my cache and refreshing (ctrl+shift+r) but only once. Not sure what the exact trigger is.

averyjohnston avatar Sep 04 '24 21:09 averyjohnston

Thank you for the issue! I was unable to reproduce this using Chrome 126, Firefox 128/129/130 or Safari 17. However, after updating Chrome to 128.0.6613.120 I am able to see the error in the original StackBlitz reproduction.

This seems to be caused by Chrome enforcing accessibility rules more strictly. I am marking this as needs: investigation because we will need to investigate the best way to fix this.

brandyscarney avatar Sep 04 '24 22:09 brandyscarney

I confirm that I am facing the same issue with the latest version of Chrome.

gasci avatar Sep 05 '24 05:09 gasci

The same here "@ionic/angular": "^8.2.0"

Hambat avatar Sep 12 '24 19:09 Hambat

Thank you for submitting the issue! I was also able to reproduce the issue.

The error is happening because tabindex and aria-hidden are being passed to ion-backdrop. The tabindex attribute is used to make an element focusable, regardless of value. When aria-hidden is applied to an element, then the element is hidden from screen readers. This violates the accessibility standards since ion-backdrop would be considered a focusable element but not visible to screen readers.

We'll be implementing a solution soon.

thetaPC avatar Sep 12 '24 23:09 thetaPC

Are there any workarounds that would suppress this error, until the proper fix is released? Don't care about screen readers in my project, I just want to get rid of the error, so it doesn't pollute error logs.

zolakt avatar Oct 16 '24 14:10 zolakt

I have added "CUSTOM_ELEMENTS_SCHEMA" which resolved this issue.

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

@Component({ selector: 'app-basic-data', standalone: true, templateUrl: './basic-data.page.html', styleUrls: ['./basic-data.page.scss'], imports: [CommonModule, IonicModule, ReactiveFormsModule], providers: [ModalController, BasicDataService, AlertsService, UtilsService, LoadingService], schemas: [CUSTOM_ELEMENTS_SCHEMA], })

shehzad031248 avatar Oct 20 '24 09:10 shehzad031248

@shehzad031248 - Can you please post the sample code?

seatechdev avatar Oct 20 '24 19:10 seatechdev