Tab order jumping to URL after tabindex 0

2.4k views Asked by At

I have a issue with taborder. In a webpage i have elements with custom tabindex, tab order is jumping to url after tabindex 0 and then returning to tabindex 1. How can i restrict the taborer going to URL. can anyone give idea why it is happening.

Thanks.

1

There are 1 answers

1
Jon Uleis On

You should be starting with tabindex="1".

tabindex="1" (or any number greater than 1) defines an explicit tab order. This is almost always a bad idea.

tabindex="0" allows elements besides links and form elements to receive keyboard focus. It does not change the tab order, but places the element in the logical navigation flow, as if it were a link on the page.

With a caveat:

In theory, tabindex should only be used in cases where:

  • The default tab order is not ideal, AND
  • The tab order cannot be changed by rearranging items in the content and/or by altering the style sheet to reflect the best visual arrangement.

Source: http://webaim.org/techniques/keyboard/tabindex