]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commit
Use tabindex of -1 to make an element focusable 10347/head
authorVincent <Vinnl@users.noreply.github.com>
Wed, 5 Jul 2017 10:31:56 +0000 (12:31 +0200)
committerVincent Tunru <projects@vinnl.nl>
Fri, 7 Jul 2017 09:23:30 +0000 (11:23 +0200)
commit57555cc07aef7938a528cd2f2e4c2420b0836aeb
tree46ae992a5476f55da771a34950e7a08e9767362f
parent717162a49c0761bd9defd38dccfa97ff735b0423
Use tabindex of -1 to make an element focusable

If we add `tabindex="0"`, an element does become focusable, but it is also inserted in the tab order - even if there's no way to interact with it.

By setting the tabindex to -1, the element becomes focusable, but it does not receive focus when tabbing through the page.

See https://stackoverflow.com/questions/44909339/why-does-foundation-recommend-adding-a-tabindex-0-to-main-content
docs/pages/visibility.md