We use tabIndex = -1 to make sure an element does not receive focus when navigating using TAB and SHIFT+TAB. However, some elements are temporarily made focusable to prevent the control from losing focus in some situations, and in that case removing tabindex completely makes more sense than assigning a value of -1 which does take it out of tab flow, but the element remains focusable, which may not be desirable.
Investigate! Search (using RegEx) for: tabindex.*\s.*=.*\s.*-1
EDIT: The relevant section from issue 6 is pasted below:
Note to self: Remember that tab flow is tricky!
elm.tabIndex returns -1 for non-focusable elements.
elm.tabIndex = -1; makes the element focusable by click/touch (sigh!) and adds the tabindex="-1" attribute.
elm.tabIndex = 0; makes the element focusable and part of tab flow.
The only way to prevent the element from gaining focus now, is by removing the attribute: elm.removeAttribute("tabindex").
aLink.tabIndex returns 0 by default and always receive focus when clicked - this can not be disabled, only hacked with an event handler removing focus again. A value of -1 takes it out of tab flow.
elm.tabIndex returns 0 by default on IE, indicating that any element is focusable - elm.getAttribute("tabindex") must be used to determine whether tabIndex has been explicitely set.
Some version(s) of WebKit (and possibly other browsers) have had bugs where tabIndex could assume undefined.
HTML controls with the disabled attribute does not gain focus when using the TAB key.
Browsers used to allow tabIndex values higher than 0, but this is now discouraged.
We use
tabIndex = -1
to make sure an element does not receive focus when navigating using TAB and SHIFT+TAB. However, some elements are temporarily made focusable to prevent the control from losing focus in some situations, and in that case removing tabindex completely makes more sense than assigning a value of -1 which does take it out of tab flow, but the element remains focusable, which may not be desirable. Investigate! Search (using RegEx) for:tabindex.*\s.*=.*\s.*-1