wish help you to fix your issue Both of your examples are fine and should not be flagged. Something else must be going on. Is the code you posted exactly what was being tested? ARIA attributes should be used sparingly and are only meant to be used when native markup isn't sufficient. For links, as you said, if there's any text between the ..., then that's "discernible text".
it should still fix some issue I'm trying to add the aria-label attribute to a link to make it more accessible. When I'm doing this, it works as expected: , It's the dash on the label creating the problem. Try this instead:
like below fixes the issue ARIA does not define how assistive tech are to expose UI. It does define how browsers are required to expose roles, states and properties via accessibility APIs. It's the same with HTML in general, the HTML spec does not define/require UI, that is left up to the browsers to decide. In the case of aria-label (for example) it is a requirement in ARIA that aria-label is mapped to the accessible name property in accessibility APIs, it is not a requirment that screen readers announce it, or not, on any given element (i.e. expose as part of the aural UI). General observed rule is that screen readers will announce accessible names and accessible descriptions on interactive elements. They will announce accessible names on most grouping elements and sectioning elements. They will announce neither on most text level elements. Note: the above also applies to any element that has it's default semantics overidden with ARIA roles. For example ARIA widget roles will have both acc name and description announced, like native HTML interactive elements.
Making a Search Form Accessible: label vs aria-label vs aria-labelledby