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-select: [a11y] the aria-label of ui5-select is overridden by the aria-labelledby attribute #2142

Closed
zhangliangyi opened this issue Aug 25, 2020 · 7 comments · Fixed by #2587

Comments

@zhangliangyi
Copy link

Describe the bug
When set the aria-labelledby attribute in ui5-select, the screen reader will not output the label defined instead of the text of selected option

To reproduce
Steps to reproduce the behavior:
Considering following case,

<ui5-label id="myLabel3" for="mySelect" required show-colon>Job</ui5-label>
<ui5-select id="mySelect" aria-required="true" aria-labelledby="myLabel3">
	<ui5-option>Manager</ui5-option>
	<ui5-option>Sales</ui5-option>
	<ui5-option selected>Developer</ui5-option>
</ui5-select>

Expected behavior
The label of ui5-select should be output by screen reader

Screenshots
Please refer to the DOM structure in the screenshot
image

Context

  • UI5 Web Components version: 0.23.1
  • OS/Platform: MacOs
  • Browser (if relevant): Chrome
  • Other information: screen reader - NVDA

Affected components (if known)
ui5-select

@ilhan007 ilhan007 added this to Top Priorities in UI5 Web Components - Roadmap via automation Aug 25, 2020
@ilhan007 ilhan007 added this to the 0.23.2 milestone Aug 25, 2020
@ilhan007
Copy link
Member

ilhan007 commented Aug 25, 2020

Hello @zhangliangyi

I think both the text of the selected item and the the labelled element would be read by the Screen Reader.
As you can from your image both "Status" and "Not started" are set as aria-label and aria-labbelledby inside the Shadow DOM. Isn't this the case? This is at least what I get with VoceOver + Chrome + MacOS.

Is it ok for you to get both texts read out or you expect to hear the labelled element only?
Because, from ACC point of view I think it is fine both texts to be announced (I will check that with our local ACC experts meanwhile).

BR,
ilhan

@ilhan007 ilhan007 self-assigned this Aug 25, 2020
@ilhan007
Copy link
Member

Hello @elenastoyanovaa

What do you think about the following: if the ui5-select component is labelled by element (<ui5-select aria-labelledby="myLabel3"). Do you think that it is wrong if the screen reader announce the selected item as well (the labelled element "myLabel3" would be read afterwards).

  • option a: only the labelled element should be read
  • option b: both the selected item text and the labelled element should be read

@zhangliangyi
Copy link
Author

zhangliangyi commented Aug 26, 2020

@ilhan007
I agree with you that the option b is the right way for this case. But in my local NVDA, only the selected option is output by screen reader when I focus on the select component.
Anyway, I will try it again today to collect more information about it and get back to you asap.

Thanks.

@zhangliangyi
Copy link
Author

zhangliangyi commented Aug 26, 2020

Here is some documentation about the relationship between aria-label and aria-labelledby.
https://developers.google.com/web/fundamentals/accessibility/semantics-aria/aria-labels-and-relationships

Importantly, aria-labelledby overrides all other name sources for an element. So, for example, if an element has both an aria-labelledby and an aria-label, or an aria-labelledby and a native HTML label, the aria-labelledby label always takes precedence.

So maybe this is the cause of my issue.

@ilhan007
Copy link
Member

Hello @zhangliangyi thanks for the info, I will prepare a change for that, leaving just one of the attributes.

@ilhan007 ilhan007 removed this from Top Priorities in UI5 Web Components - Roadmap Sep 2, 2020
@ilhan007 ilhan007 added this to Core Team in Planning - Topic Core Sep 4, 2020
@ilhan007 ilhan007 assigned nnaydenow and unassigned ilhan007 Sep 14, 2020
@ilhan007 ilhan007 modified the milestones: 0.23.2, 0.23.3 Sep 14, 2020
@ilhan007 ilhan007 added this to 0.23.3 (28 Sept 2020) in UI5 Web Components - Roadmap Sep 14, 2020
@ilhan007 ilhan007 modified the milestones: 0.23.3, 0.23.4 Sep 30, 2020
@ilhan007 ilhan007 moved this from 0.23.3 (28 Sept 2020) to 0.23.4 in UI5 Web Components - Roadmap Sep 30, 2020
@ilhan007 ilhan007 moved this from 0.23.4 (6 Oct 2020) to 0.23.5 in UI5 Web Components - Roadmap Oct 6, 2020
@ilhan007 ilhan007 modified the milestones: 0.23.4, 0.23.5 Oct 6, 2020
@ilhan007 ilhan007 moved this from 0.23.5 to 0.23.6 in UI5 Web Components - Roadmap Oct 8, 2020
@ilhan007 ilhan007 moved this from 0.23.6 (27 Oct) to 0.23.7 (10 Nov) in UI5 Web Components - Roadmap Oct 8, 2020
@ilhan007 ilhan007 modified the milestones: 0.23.5, 0.23.7 Oct 8, 2020
@ilhan007 ilhan007 moved this from Core to Topic P in Planning - Topic Core Oct 14, 2020
@jdichev
Copy link

jdichev commented Oct 30, 2020

Hello, the issue is being worked on.
Internal reference: 4887

@ilhan007 ilhan007 modified the milestones: 0.23.7, 0.23.8 Nov 16, 2020
@ilhan007 ilhan007 removed this from Topic P in Planning - Topic Core Nov 16, 2020
@ilhan007 ilhan007 moved this from 0.23.7 (10 Nov) to 1.0.0-rc.11 (start of December) in UI5 Web Components - Roadmap Nov 16, 2020
@ilhan007 ilhan007 added this to Topic P in Planning - Topic Core Nov 16, 2020
@ilhan007 ilhan007 modified the milestones: 0.23.8, 0.23.9 Nov 16, 2020
@ilhan007 ilhan007 modified the milestones: 0.27.1, 0.27.3 Dec 9, 2020
@ilhan007 ilhan007 moved this from 1.0.0-rc.11 (start of December) to 1.0.0-rc.12 (start of January 2021) in UI5 Web Components - Roadmap Dec 9, 2020
@ilhan007 ilhan007 modified the milestones: 0.27.3, 0.27.4 Dec 21, 2020
ilhan007 pushed a commit that referenced this issue Jan 4, 2021
- Role of the ui5-select is changed to combobox which change the speech output near to the default behavior. 
- The issue where role="button" can't be used with aria-required / required attribute is fixed. 
- Overwriting the aria-label speech output with aria-labelledby is fixed.

Fixes: #2485
Fixes: #2339
Fixes: #2142
@nnaydenow
Copy link
Contributor

Hello @zhangliangyi,

The internal aria-labelledby is removed when the role was changed to combobox, because it provides different accessibility behavior.

ilhan007 pushed a commit that referenced this issue Jan 13, 2021
- Role of the ui5-select is changed to combobox which change the speech output near to the default behavior. 
- The issue where role="button" can't be used with aria-required / required attribute is fixed. 
- Overwriting the aria-label speech output with aria-labelledby is fixed.

Fixes: #2485
Fixes: #2339
Fixes: #2142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants