Fixed Dismiss notice link lacks aria-label for a link without any text

Xon

Well-known member
Affected version
2.2.15
In the public:notice_macros:notice macro there is this:
Code:
<a href="{{ link('account/dismiss-notice', null, {'notice_id': $notice.notice_id}) }}" class="notice-dismiss js-noticeDismiss" data-xf-init="tooltip" title="{{ phrase('dismiss_notice')|for_attr }}"></a>
The title attribute is removed so screen readers don't see it.

Adding an aria-label should fix that;
Code:
<a href="{{ link('account/dismiss-notice', null, {'notice_id': $notice.notice_id}) }}" class="notice-dismiss js-noticeDismiss" aria-label="{{ phrase('dismiss_notice')|for_attr }}" data-xf-init="tooltip" title="{{ phrase('dismiss_notice')|for_attr }}"></a>

Perhaps the XF.Tooltip should automatically push an aria-label for elements without any children but with a title?
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.16).

Change log:
Set aria-label for tooltips with no children
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom