Exposing ngAria's "clickrole" property

User671910
ServiceNow Employee
ServiceNow Employee

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

Prakhar7
ServiceNow Employee
ServiceNow Employee

There is no one-stop global config that could be turned off. However, there are 2 ways to do it locally on the element:

  1. turn off ngAria on the div element by adding the `ng-aria-disable` attribute.
  2. 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).