SlickNav – Google Lighthouse Accessibility issue for collapsed menu button


I use Slicknav for my mobile menu, and Lighthouse flags up the following:

Links do not have a discernible name – a.slicknav_btn.slicknav_collapsed

I assume it means this element

<a href="#" aria-haspopup="true" tabindex="0" class="slicknav_btn slicknav_collapsed"><span class="slicknav_menutxt">MENU</span><span class="slicknav_icon"><span class="slicknav_icon-bar"></span><span class="slicknav_icon-bar"></span><span class="slicknav_icon-bar"></span></span></a>

Diving into the slicknav.js, I was thinking this is the correct portion of the code? I am trying to work out how to modify this to produce the correct label but so far I just get errors.

    iconClass = prefix + '_icon';

    if (settings.label === '') {
        iconClass += ' ' + prefix + '_no-text';

    if (settings.parentTag == 'a') {
        settings.parentTag = 'a href="#"';

Any ideas on how to fix this?

, Obsidian 3 years 2020-04-02T12:51:12-05:00 0 Answers 97 views 0

Leave an answer