admin管理员组

文章数量:1394089

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?

本文标签: SlickNavGoogle Lighthouse Accessibility issue for collapsed menu button