Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab order jumping to URL after tabindex 0

Tags:

html

tabindex

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.

like image 242
anu Avatar asked Dec 23 '16 05:12

anu


People also ask

What is the difference between Tabindex 1 and Tabindex 0?

tabindex="1" (or any number greater than 1) defines an explicit tab or keyboard navigation order. This must always be avoided. tabindex="0" allows elements besides links and form elements to receive keyboard focus.

What determines the tab order?

Control tab order is determined by the order in which controls are drawn on the screen. The first control that you draw is assigned a tab order of 1 , the next is given tab order number 2 , and so on.


1 Answers

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

like image 89
Jon Uleis Avatar answered Nov 07 '22 05:11

Jon Uleis