You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: Accessibility issue: Backdrop in ion-popover component has invalid aria-hidden value #29773
I have searched for existing issues that already report this problem, without success.
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
Open the element
Click on backdrop
Popover will be dismissed and console error will appear
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
Reacted by Saeb Amini, Mohammad Hasan Khan, Michael, Andreas Clement Holmgaard, Göktuğ Aşcı, Maciej Bukowski, seatechdev, David Strauß, Sina Aghajani and jㄐ
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.
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.
Reacted by Sören, seatechdev, David Strauß, Dimitri Steinel, Tobias Thiele, Anna Melnyk, Ethan Tuning, iOnCourt, Yevhenii Herasymchuk, Michal Jancar and 10 more
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.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
dev-charles15531 commentedon Aug 15, 2024
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.
annamelnyk commentedon Aug 16, 2024
@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:
boluwatifee4 commentedon Aug 16, 2024
wiktor-wrzaszcz commentedon Aug 20, 2024
annamelnyk commentedon Aug 21, 2024
maniya108 commentedon Aug 21, 2024
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>D3rDicke commentedon Aug 21, 2024
ingbioservicios commentedon Aug 23, 2024
vityapro commentedon Aug 23, 2024
dangduoc commentedon Aug 24, 2024
KeyTurns commentedon Aug 24, 2024
Sagie501 commentedon Aug 25, 2024
m345054 commentedon Aug 25, 2024
doogie99 commentedon Aug 26, 2024
12 remaining items
gasci commentedon Sep 5, 2024
I confirm that I am facing the same issue with the latest version of Chrome.
Hambat commentedon Sep 12, 2024
thetaPC commentedon Sep 12, 2024
Thank you for submitting the issue! I was also able to reproduce the issue.
The error is happening because
tabindexandaria-hiddenare being passed toion-backdrop. Thetabindexattribute is used to make an element focusable, regardless of value. Whenaria-hiddenis applied to an element, then the element is hidden from screen readers. This violates the accessibility standards sinceion-backdropwould be considered a focusable element but not visible to screen readers.We'll be implementing a solution soon.
zolakt commentedon Oct 16, 2024
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.
shehzad031248 commentedon Oct 20, 2024
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],
})
seatechdev commentedon Oct 20, 2024
@shehzad031248 - Can you please post the sample code?
fix(backdrop): remove tabindex for improved accessibility (#29956)
fix(overlays): do not hide root when toast appears (#29962)
shehzad031248 commentedon Oct 27, 2024
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@component({
selector: 'app-basic-data-form',
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],
})
thetaPC commentedon Oct 28, 2024
Thanks for the issue! This has been resolved via #29956 and will be available in an upcoming release of Ionic.
ionitron-bot commentedon Nov 27, 2024
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.