re: Managing focus for accessibility VIEW POST

re: Hey Rob thanks for the tip! MDN has me telling anyone who will listen that non-interactive elements shouldn't have a tabindex. Are we just going t...

Usually that's correct--you should only give an element tabindex if a user can interact with it or provide it some input.

But for the specific case of managing focus I've often seen folks use this technique because there is no alternative way to move the users focus start point. Browsers actually have an internal API that they use to move the focus start point ( but it's not exposed to developers as a JavaScript API. The tabindex + focus() trick I showed is a sort of near term hack to achieve a similar effect.

One of the things I really want to work on next is exposing the focus start point API so this trick becomes unnecessary.

code of conduct - report abuse