Exposing ngAria's "clickrole" property

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2023 09:23 AM
Is there a way for us to override the global setting for ngAria's `clickrole` property? ngClick automatically adds `role='button'` which causes a11y issue (if ngClick is applied to non-button, like a div container).
I understand we can override this by adding `role='presentation'` but that is hacky.
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2024 02:42 AM - edited ‎09-25-2024 03:10 AM
There is no one-stop global config that could be turned off. However, there are 2 ways to do it locally on the element:
- turn off ngAria on the div element by adding the `ng-aria-disable` attribute.
- as a workaround, override the ngAria behaviour by adding role & tab index to the div if you are using ng-click on it. (this you already mentioned).