[FIX] web: Properly label buttons which change views, with aria-label

Closes #16576

Description of the issue/feature this PR addresses:
According to HTML good practices, when an element is used but there's no text displayed on the screen, the attribute aria-label should be used to label that element.

This is the case in the buttons to change view types (List, Kanban, etc) since there's no text displayed, but an icon instead.

This HTML attribute is specially useful for screen readers, which usually are not able to figure out a button's functionality when that button is not properly labeled.

Current behavior before PR:
Buttons are not properly labeled

Desired behavior after PR is merged:
Appearance should be the same, but the produced HTML should be of better quality, because it would fit more HTML good conventions and it whould be more accessible

Related issue:
I had already reported this issue on the branch 10.0 at PR #16030. However, I decided to report it on this branch, because I believe this branch is the right place to be reported.
This commit is contained in:
Luis González
2017-05-29 18:14:00 +02:00
committed by Yannick Tivisse
parent 7dcb8fea64
commit ed4b9064a1
+1
View File
@@ -96,6 +96,7 @@
<t t-foreach="views" t-as="view">
<button type="button" t-att-accesskey="view.accesskey"
t-attf-class="btn btn-icon fa fa-lg #{view.icon} o_cp_switch_#{view.type}"
t-att-aria-label="view.type"
t-att-data-view-type="view.type" t-att-title="view.label"/>
</t>
</t>