• Resolved isay81

    (@isay81)


    It is really common to have a Menu “Placeholder” page. Useful for top-level menu item – don’t go anywhere when menu item is clicked.

    Then to have the other child pages under it.

    This is giving this error:

    Improper Use of Link error

    This element is an anchor tag missing a valid href attribute or is linked to # without having role="button".

    How to fix it:

    If the element is used to trigger an action, replace the anchor tag with a <button>. If you cannot replace it, ensure that role="button" is added to the link, along with JavaScript that adds support for triggering it with the space bar key, and that appropriate ARIA attributes are used for toggle states or other functionality.

    How do I implement this fix if it is a placeholder Parent page?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author williampatton

    (@williampatton)

    Hi @isay81,

    Sorry that your running into troubles with this. It is very unfortunate that many themes or builders don’t produce accessible menus by default for things like this 🙁

    A link ethat doesn’t take anyone anywhere is a difficult thing for a non-sighted user to understand because their screen reader will read out that it’s a link.

    The ideal solution for this to to make the dropdown opener a button rather than a link. Using an actual <button> element would be best, but alternatively, swapping the role and adding handling for the spacebar would work too.

    In either case you would need to add some aria, like aria-expanded to tell screen readers and other assistive tech the state of the dropdown when it is opened or closed.

    Fixing this likely requires some code changes or code additions to handle if your theme or builder doesn’t provide the means to do it.

    Since this isn’t an issue with the plugin I will mark the thread as resolved but that doesn’t mean we won’t continue to help. If you need any additional help with this feel free to reply here and I will get back to you with help as soon as I am able.

    • This reply was modified 4 months, 2 weeks ago by williampatton.
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.