Giter VIP home page Giter VIP logo

Comments (5)

nagaozen avatar nagaozen commented on September 24, 2024

Hi @zachleat, thank you for pointing this out!

Initially I thought we made the right call on this because, as you said:

"... elements do not contain focusable elements ..."

So, I went to the to source looking for the aria-hidden on the header tag but instead found it on the a tag. Well, that tag does not contain focusable elements, it is the focusable element! And because of https://webaccessibility.com "Avoid placing inactive elements in the focus order" Best Practice that states:

Elements on the page that are not interactive (those that do not trigger an action) such as labels, headings, etc. should not be in the keyboard focus order. Providing focus to non-active elements may give users of assistive technology the impression that the element is interactive and cause keyboard users to have to use extra keystrokes to navigate. In some specific situations (such as dire warnings or disabled controls that require changes for them to become enabled) it may be acceptable and necessary to place a limited number of non-interactive elements in the focus order. Setting focus programmatically to certain content that is not interactive such as error messages may also be acceptable.

It made sense that for a better UX it was the right call to remove that inactive element from the focus order...

But after further research I found out that MDN clearly says:

According to the fourth rule of ARIA, aria-hidden="true" should not be used on a focusable element. Additionally, since this attribute is inherited by an element's children, it should not be added onto the parent or ancestor of a focusable element.

And an HTMLAnchorElement with a href is, hands down, considered to be a focusable element.

So I think this should be changed.

from markdown-it-anchor.

nagaozen avatar nagaozen commented on September 24, 2024

Any additional words on this topic @valeriangalliat?

from markdown-it-anchor.

nagaozen avatar nagaozen commented on September 24, 2024

While we are still discussing this, what about changing it to: role="presentation"?

from markdown-it-anchor.

nagaozen avatar nagaozen commented on September 24, 2024

Fixed on 5.2.5

from markdown-it-anchor.

binyamin avatar binyamin commented on September 24, 2024

@zachleat @nagaozen I would like to revisit this point. How will screen-readers know to ignore the permalinkSymbol? Also, the devtools tell me that GitHub puts aria-hidden="true" on its markdown permalink thingies.

markdown permalink symbols

I like #58 (comment), though I think it's role="none" currently. Edit: axe cli doesn't like that suggestion.

from markdown-it-anchor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.