layout | tags |
---|---|
doc-api.html |
argument-list |
Determines if an element is considered tabbable and not focusable.
An element is considered tabbable and not focusable if the element is part of the document's focus navigation sequence, but cannot be focused by script.
Consult the data tables what browsers consider focusable and what ally.js fails to consider focusable to learn how HTML elements behave.
var element = document.getElementById('victim');
var isOnlyTabbable = ally.is.onlyTabbable(element);
Name | Type | Default | Description |
---|---|---|---|
element | HTMLElement |
required | The Element to test. |
The underlying rules can also be accessed in the options
argument style by calling ally.is.onlyTabbable.rules(options)
:
Name | Type | Default | Description |
---|---|---|---|
context | <selector> |
required | The element to examine. The first element of a collection is used. |
except | <focus identification exception> |
{} |
The Element to test. |
Boolean, true
if the element is only tabbable.
TypeError
if element
argument is not of type HTMLElement
.
- Since
v1.1.0
all<object>
elements in Internet Explorer are not considered only tabbable anymore. - Since
v1.1.0
exceptions can be passed toally.is.onlyTabbable.rules(options)
. - Since
v1.1.0
the state of the<iframe>
or<object>
element in which the currently examined element is hosted in is considered. - Since
v1.1.0
elements must be visible to be considered only tabbable.
- NOTE: there is no way to feature detect if an element is tabbable or not. The
Element.tabIndex
property gives some indication, but ultimately user agent sniffing (via platform.js) is done internally to fix mismatches.
-
ally.is.focusRelevant
is used to identify elements that can receive focus -
ally.is.focusable
identifies focusable elements -
ally.is.tabbable
identifies keyboard focusable elements