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
[Navigation][Tabs][Carousel][Button] There's no possibility to add labels to the components #586
Comments
@jakublamprecht - thanks, this one would require an author defined label per navigation so we would have to put some thought into if and how we would like this to be defined in the dialog. |
@gabrielwalt, I see two ways of supporting this, the second being a bit more involved. What do you think? Option 1: Allow only a label to be defined by an author for accessibility reasons.Edit Dialog Field
Markup
Option 2: Allow a title to be defined for a navigation, which is displayed on the page and can optionally be displayed as an accessibility label.Edit Dialog Field 1
Field 2
Field 3
Markup
or, if
|
@richardhand I changed the title and description of this issue to also include the tabs and carousel components, since it adresses the same issue in all those components. |
Thanks @jakublamprecht - I guess these labels should also be unique (for Carousel and Tabs) per component instance and therefore configurable by an author, rather than a hard-coded value as is the case with |
From what I've seen yes, they should be authorable, since they're supposed to describe the purpose of the tablist that the label is added too. I guess that any generic information will already be provided by roles/landmarks. |
@richardhand I've found some additional issues regarding the carousel component. According to this: https://www.w3.org/TR/wai-aria-practices/#carousel carousel component need to have These are the non-breaking changes. I've found also, that there's an issue with order of elements in the markup - W3C says that the rotation control buttons (pause and play) are supposed to be the very first elements in tab order, which would require them to be moved in HTL. Also the pattern mentions that when carousel elements (other than the rotation control buttons) are focused, the carousel should be paused until user clicks the play button. This is not implemented. This would require some additional JavaScript and probably moving those buttons out of "cmp_carousel__content" like this:
This markup structure would help us in detecting whether focus is inside the carousel content and the carousel should be paused (one eventListener would be enough here), or focus is outside the content (e.g on the play/pause button) and we do not have to pause the carousel. I will provide the fixes for non-breaking changes in this PR and create a separate issue for the other changes, since they probably would require a new version of component to be released. |
I think the
makes sense to add this.
Thanks! We can continue the discussion on the other points in the new issue. |
@richardhand That makes sense to change to role to
I think this is not necessary, since in the carousel slides have role set to |
Right, thought we might still benefit from the role description but seems it's not recommended. |
Code is merged to master and will be available in the upcoming 2.6.0 Release. |
Bug Report
Current Behavior
Navigation component does not allow authors to specify labels for navigation, tabs and carousel (useful if more than one navigation component is present on the page) as W3C suggests here:
https://www.w3.org/WAI/tutorials/menus/structure/#label-menus
https://www.w3.org/TR/wai-aria-practices/#tabpanel
Using
aria-label
would probably require less work, since usingaria-labeledby
would come with adding possibility to choose heading level for the label.Expected behavior/code
Authors can specify labels for navigation, tabs, carousel and button components.
Environment
The text was updated successfully, but these errors were encountered: