nico3333fr/van11y-accessible-tab-panel-aria

js-link-to-tab error: Cannot read property 'querySelectorAll' of null

Jakob-Maudience opened this issue · 0 comments

Here are my tabs:

<div class="js-tabs">
    <ul class="js-tablist" data-hx="h2">
        <li class="js-tablist__item">
            <a href="#tab_1" class="js-tablist__link">Tab 1</a>
        </li>
        <li class="js-tablist__item">
            <a href="#tab_2" class="js-tablist__link">Tab 2</a>
        </li>
    </ul>
    <div id="tab_1" class="js-tabcontent">
        This is tab 1
    </div>
    <div id="tab_2" class="js-tabcontent">
        This is tab 2
    </div>
</div>

<a href="#tab_2" class="js-link-to-tab">Link to tab 2</a>

When I click on the "Link to tab 2" tag at the bottom, I get the error Cannot read property 'querySelectorAll' of null at HTMLBodyElement.<anonymous> (van11y-accessible-tab-panel-aria.js:442)

Here's the line the error is pointing to in the console:
image