fix: accessibility problem with more button on tablist #1029
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes: #987
When the tab list does not fit into view, the more button was causing an accessibility violation error.
This has been corrected by moving the tablist role to the grid and the popover tablist.
Note this still does not make this component fully accessible, but it does remove the accessibility violation errors. There is another issue (issues/700) that I will address after this fix is applied.
Rather than having the role of tablist on the root of the component, it has been placed on the parts of the dom which directly house the tabs. This has meant requiring two tablists - one for the normal list, and one for the "more" list.
It should be noted that a previous pull request was attempted to keep a single tablist. This could not be achieved with the more button pattern which works well for the Workspace Views Tabs Navigation. This pull request supersedes that one.
Types of changes
Motivation and context
Removes an accessibility violation
How to test?
Navigate to the tabs component in the Umbraco.UI story book. Click on the accessibility tab. If the browser is wide enough you will see 0 violations.
Reduce the browser size so that the more button appears and refresh the page. You will see 1 violation before the fix is applied because an element of role tablist is not allowed children other than of role tab, and now there is a button in there for the popup.
After the fix the violations will be 0.
Screenshots (if appropriate)
Tests updated to show accessibility fail (before fix):
Accessibility checker in story book (after fix):
Checklist