• Resolved Khuyen Nguyen

    (@khuyennguyen)


    I’m just installing generatepress theme and in my post, in have created one menu structure with nav tag. Inside nav tag have anchor link with hash. And when i click on this link. My console show an error

    Uncaught TypeError: Cannot read property 'className' of null
        at HTMLAnchorElement.t (a11y.min.js:1)

    I think problem may be come from
    while ( -1 === self.className.indexOf( 'main-nav' ) )

    When you select all nav tag nav ul a while my nav is not related in main nav.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author Tom

    (@edge22)

    Strange, we don’t select nav ul a in that file. Any chance you can link me to your site?

    Thread Starter Khuyen Nguyen

    (@khuyennguyen)

    Sorry but my site is under localhost. You can check it in file a11y.js.
    var navLinks = document.querySelectorAll( 'nav ul a' ). I think the problem is here.
    Or you can create a nav structure in you post (nav ul li a) with anchor has a hash to scroll.

    Theme Author Tom

    (@edge22)

    Ah yes, confirmed.

    Can you try changing it to this?:

    navLinks = document.querySelectorAll( 'nav .main-nav ul a' )

    Thread Starter Khuyen Nguyen

    (@khuyennguyen)

    I’m just fix it today. Thank you very much, Tom!

    Theme Author Tom

    (@edge22)

    No problem! Thanks for reporting this 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Bug] Error if post have more than one nav’ is closed to new replies.