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

ui5-button: aria-labels not working for screen readers #1425

Closed
ee92 opened this issue Apr 3, 2020 · 4 comments
Closed

ui5-button: aria-labels not working for screen readers #1425

ee92 opened this issue Apr 3, 2020 · 4 comments
Assignees
Labels

Comments

@ee92
Copy link

ee92 commented Apr 3, 2020

Describe the bug
ui5-buttons with aria-label or aria-labelledby are being read out by their text content instead of the aria labels.

To reproduce
Steps to reproduce the behavior:

  1. Go to https://sap.github.io/ui5-webcomponents/playground/components/Button/
  2. While using any screen reader (mac VoiceOver, JAWS, NVDA), tab over the icon buttons that have aria-labelledby.
  3. Notice they just read out 'button' or 'Positive Action button' or 'Negative Action button' and ignore the aria labels.

Expected behavior
Adding aria-label or aria-labelledby attributes should conform to the w3c web content accessibility guidelines.

Screenshots
Screen Shot 2020-04-03 at 9 10 47 AM

@ee92 ee92 changed the title ui5-button ui5-button: aria-labels not working Apr 3, 2020
@ee92 ee92 changed the title ui5-button: aria-labels not working ui5-button: aria-labels not working for screen readers Apr 3, 2020
@fifoosid fifoosid self-assigned this Apr 6, 2020
@fifoosid
Copy link
Contributor

fifoosid commented Apr 6, 2020

Hi @ee92

In the example you have provided the reason for the texts not to be read is because they have inline style display:none. If you remove it then the aria-labelledby attribute is read.

If you wish to achieve this in your app and hide the texts as well you could add the following styles to your texts(or hide them from the viewport by any other way instead of display: none):

position: absolute;
left: -99999px;
visibility: hidden;

Best rergards,
Filip

@ee92
Copy link
Author

ee92 commented Apr 6, 2020

@fifoosid visible texts are not read either. You can try removing the display:none and it doesn't fix the problem.

@ee92
Copy link
Author

ee92 commented Apr 17, 2020

@fifoosid I tried the fix you made for this but get an error. Check this comment I added to the PR: #1446 (comment)

@fifoosid
Copy link
Contributor

Both aria-label & aria-labelledby are supported now

ilhan007 pushed a commit that referenced this issue Jul 30, 2021
Part of #3107 

BREAKING CHANGE: The support for ```aria-labelledby``` have been deprecated in favour of  new attribute ```accessible-name-ref``` for the following components:
- ComboBox (Requested by SF #1916)
- DatePicker (Requested by SF #2107)
- Input (Requested #1866)
- List (Requested by SF #1886)
- Rating Indicator
- Select (Requested by SF #2107)
- StepInput (Implemented as part of the initial implementation #2804)
- TextArea (Requested by SF #2107)
- WizardStep (Implemented as part of the initial implementation #2400)
The ```aria-labelledby``` has been deprecated for the following component:
- Button (Requested by SF #1425)
The ```accessible-name``` has been deprecated for the following components:
- Link (Requested by SF #2356)
 Both ```aria-labelledby``` and ```accessible-name``` have been deprecated for the following components:
- Card (Requested by CBC #2127)
- CheckBox (Requested by SF #2265)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants