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/spanspan class="slicknav_icon"span class="slicknav_icon-bar"/spanspan class="slicknav_icon-bar"/spanspan 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?

Topic accessibility menus Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.