This adds `role="button"` and uses `aria-disabled="true"` for anchors
created via `LinkButton`.
Before the non-working attribute `disabled` was implemented for the
`a`-tag.
Reference/information:
MDN:
https://developer.mozilla.org/en-US/docs/Web/HTML
Easy readable.
WHATWG HTML Standard:
https://html.spec.whatwg.org/multipage/
Kind of readable.
W3C: Accessible Rich Internet Applications (WAI-ARIA)
https://w3c.github.io/aria/#aria-disabled
Only read for details.
About disabled-attribute:
MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled#overview
WHATWG: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute
The disabled attribute is supported by <button>, <fieldset>, <optgroup>, <option>, <select>, <textarea> and <input>.
So disabled attribute is not supported by html-element <a>.
Additional about role="button"-attribute:
MDN: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role
WAI-ARIA: https://w3c.github.io/aria/#button
WHATWG: https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-autonomous-drawbacks
MDN:
Adding role="button" tells the screen reader the element is a button, but provides no button functionality.
WHATWG:
The addition of an ARIA role and various ARIA states and properties helps convey semantics to accessibility technology. […] And setting the aria-disabled state to "true" when the button is logically disabled conveys to accessibility technology the button's disabled state.
So role="button" does not convert the <a>-element into a<button>-element. And thereby the disabled-attribute can still not be used for<a role="button">`.
Attention:
Actually it's always better to use real <button>-elements when possible, as otherwise all the states must be re-implmented using JavaScript.
(My opinion - and also supported by others.)
Also see:
https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-autonomous-drawbacks
About aria-disabled-attribute:
MDN: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled
WAI-ARIA: https://w3c.github.io/aria/#aria-disabled
MDN:
Unlike HTML's disabled Boolean attribute, which will communicate a form control as semantically being disabled, change its styling to reflect its state and suppress all functionality along with disallowing the element's value from participating in form submission, the aria-disabled="true" only semantically exposes these elements as being disabled. Web developers must manually ensure such elements have their functionality suppressed when exposed to the disabled state.
Use the aria-disabled-attribute whenever there is no option to use the disabled-attribute - and re-implement all functional implications (e.g. not clickable) by JavaScript.