Skip to content

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

Closed

Description

@annamelnyk

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

Activity

  1. dev-charles15531 commented on Aug 15, 2024

    @dev-charles15531

    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.

  2. annamelnyk commented on Aug 16, 2024

    @annamelnyk
    Author

    @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
  3. boluwatifee4 commented on Aug 16, 2024

    @boluwatifee4
  4. wiktor-wrzaszcz commented on Aug 20, 2024

    @wiktor-wrzaszcz
  5. annamelnyk commented on Aug 21, 2024

    @annamelnyk
    Author
  6. maniya108 commented on Aug 21, 2024

    @maniya108

    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

  7. D3rDicke commented on Aug 21, 2024

    @D3rDicke
  8. ingbioservicios commented on Aug 23, 2024

    @ingbioservicios
  9. vityapro commented on Aug 23, 2024

    @vityapro
  10. dangduoc commented on Aug 24, 2024

    @dangduoc
  11. KeyTurns commented on Aug 24, 2024

    @KeyTurns
  12. Sagie501 commented on Aug 25, 2024

    @Sagie501
  13. m345054 commented on Aug 25, 2024

    @m345054
  14. doogie99 commented on Aug 26, 2024

    @doogie99
  15. 12 remaining items

  16. gasci commented on Sep 5, 2024

    @gasci

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

  17. Hambat commented on Sep 12, 2024

    @Hambat
  18. thetaPC commented on Sep 12, 2024

    @thetaPC
    Contributor

    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.

  19. added
    type: bug
    and removed
    needs: investigation
    on Sep 12, 2024
  20. zolakt commented on Oct 16, 2024

    @zolakt

    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.

  21. shehzad031248 commented on Oct 20, 2024

    @shehzad031248

    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],
    })

  22. seatechdev commented on Oct 20, 2024

    @seatechdev

    @shehzad031248 - Can you please post the sample code?

  23. added a commit that references this issue on Oct 22, 2024
    7294e96
  24. shehzad031248 commented on Oct 27, 2024

    @shehzad031248

    @shehzad031248 - Can you please post the sample code?

    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],
    })

  25. thetaPC commented on Oct 28, 2024

    @thetaPC
    Contributor

    Thanks for the issue! This has been resolved via #29956 and will be available in an upcoming release of Ionic.

  26. ionitron-bot commented on Nov 27, 2024

    @ionitron-bot

    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.

  27. locked and limited conversation to collaborators on Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions