Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 of 6 tasks
eric-horodyski opened this issue Aug 26, 2021 · 2 comments · Fixed by #23891
Closed
4 of 6 tasks

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

eric-horodyski opened this issue Aug 26, 2021 · 2 comments · Fixed by #23891
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement

Comments

@eric-horodyski
Copy link
Member

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

@willmartian
Copy link
Contributor

Available in the next release of Framework, ion-toast and ion-alert will accept an htmlAttributes prop, which allows developers to pass arbitrary attributes to the host element, including role. Thanks!

@ionitron-bot
Copy link

ionitron-bot bot commented Oct 15, 2021

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Oct 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants