active-menu-link icon indicating copy to clipboard operation
active-menu-link copied to clipboard

itemTag requires nested a elements

Open peterkos opened this issue 4 years ago • 0 comments

According to this function: https://github.com/Kosalexei/active-menu-link/blob/33839a071bb895a7f173b9ac76435879591f6a38/lib/index.ts#L58-L63

Any parameter set for itemTag seems to look for all subelements that must be an a. The way we have our nav structured is something like

<nav>
    <a id="logo" href="https://example.com">
        <img src="assets/logo.svg" alt="Our Logo" />
    </a>
    <a class="link" href="#general">GENERAL</a>
    <a class="link" href="#schedule">SCHEDULE</a>
    <a class="link" href="#faq">FAQ</a>
    <a class="link" href="#about">ABOUT US</a>
</nav>

As a feature suggestion, it'd be cool if itemTag was more of an itemQuery or something, so we could pass in, say,

itemTag: "a.link"

and leave out things like our logo, and other banners.

Awesome little library btw :smile:

peterkos avatar Dec 22 '20 00:12 peterkos