Skip to content

bug: expose role attribute on ion-alert + ion-toast  #23825

@eric-horodyski

Description

@eric-horodyski

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

While working with a community member, it was observed that there is no way to modify the role attribute for the IonToast and IonAlert components.

Expected Behavior

As a developer, I would like to have the ability to set the role attribute as my application would like to set this attribute to alert for both components.

IonAlert sets role="dialog" but in this application's accessibility context it needs to be set to "alert".

Steps to Reproduce

Using the AlertController and ToastController there is no ability to manually set the role attribute.

Code Reproduction URL

https://github.com/eric-horodyski/fw-ng-alert-toast-a11y

Ionic Info

Ionic:

   Ionic CLI                     : 6.17.0 (/Users/eric/.volta/tools/image/packages/@ionic/cli/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.6.14
   @angular-devkit/build-angular : 12.1.4
   @angular-devkit/schematics    : 12.2.2
   @angular/cli                  : 12.1.4
   @ionic/angular-toolkit        : 4.0.0

Capacitor:

   Capacitor CLI      : 3.2.0
   @capacitor/android : not installed
   @capacitor/core    : 3.2.0
   @capacitor/ios     : not installed

Utility:

   cordova-res : 0.15.3
   native-run  : 1.4.0

System:

   NodeJS : v14.17.0 (/Users/eric/.volta/tools/image/node/14.17.0/bin/node)
   npm    : 7.14.0
   OS     : macOS Big Sur

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions