-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
improvement: update umb-tabs to use better semantic markup #7926
improvement: update umb-tabs to use better semantic markup #7926
Conversation
# Conflicts: # src/Umbraco.Web.UI/Umbraco/config/lang/en.xml # src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MMasey Thanks! I have left some comments around buttons, you can accept them if you agree!
<li ng-click="vm.clickTab($event, tab)" class="umb-tab" role="tab" aria-selected="true" tabindex="0" ng-repeat="tab in vm.tabs | limitTo: vm.maxTabs" data-element="tab-{{tab.alias}}" ng-class="{'umb-tab--active': tab.active, 'umb-tab--error': tabHasError}" val-tab> | ||
<a>{{ tab.label }}</a> | ||
<li class="umb-tab" ng-repeat="tab in vm.tabs | limitTo: vm.maxTabs" data-element="tab-{{tab.alias}}" ng-class="{'umb-tab--active': tab.active, 'umb-tab--error': tabHasError}" val-tab> | ||
<button class="btn-reset umb-tab-button" ng-click="vm.clickTab($event, tab)" role="tab" aria-selected="{tab.active}">{{ tab.label }}</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember any buttons without a type
attribute will just submit whatever form it might be in, need to always specify type="button"
.
<button class="btn-reset umb-tab-button" ng-click="vm.clickTab($event, tab)" role="tab" aria-selected="{tab.active}">{{ tab.label }}</button> | |
<button type="button" class="btn-reset umb-tab-button" ng-click="vm.clickTab($event, tab)" role="tab" aria-selected="{tab.active}">{{ tab.label }}</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah good catch, i've updated the PR.
src/Umbraco.Web.UI.Client/src/views/components/tabs/umb-tabs-nav.html
Outdated
Show resolved
Hide resolved
I just realised that you had done a change request, not just comments 😂 Either way, it should be sorted now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't break anything. Thanks for the changes Mike!
Sweet, thanks for the update @MMasey no worries about not spotting the changes suggestions! 🍻 |
This PR improves the markup for the umb-tab used for example in the settings dashboard.
The old version of the code was using anchor tags etc when it should have been using buttons. I've also added some screen reader only text for the more options toggle when on a narrower screen.
The outcome itself visually is minimal, other than only showing the focus state when using the keyboard to navigate via tabbing.