- Changed code formatting to use dangling commas where ES5 supports them.
- Fixed a bug where
<audio controls />
and<video controls />
elements withouttabindex
attribute specified would be deemed NOT tabbable in Chrome, but would be in FireFox, because Chrome hastabIndex
(the DOM Element property) returning -1 (focusable, but not tabbable), while FireFox hastabIndex
returning 0 (focusable, and tabbable), yet both browsers include these elements in the regular tab order (as iftabIndex
was 0 for both browsers). Now these elements are considered tabbable in Chrome too! - Add any
<summary>
element directly under a<details>
element as tabbable and focusable. - BREAKING: Changes to the
isTabbableRadio()
internal function in order to better support nested radio buttons:- In case a form parent element exists, include only nested radio inputs from that form.
- Ignore checked radio elements from forms different from the one the validated node belongs to.
- NOTE: This may result in less radio elements being flagged as tabbable depending on context from the "root" node given to
tabbable()
.
- BREAKING: The exports have changed to be all named, and separate, as follows in order to help make the module more compatible with tree shaking:
tabbable
-> `import { tabbable } from 'tabbable';tabbable.isTabbable
-> `import { isTabbable } from 'tabbable';tabbable.isFocusable
-> `import { isFocusable } from 'tabbable';
- Also to help with tree shaking,
package.json
now statessideEffects: false
to mark this module as having no side effects as a result of merely importing it. - Added new UMD build, see
./dist/index.umd.*
.
- Improve performance by changing the method for detecting whether a DOM node is focusable or not. It's expected that this change will not affect results; but this is a major version bump as a warning for you to check your edge cases before upgrading.
- Fix reference to root element that caused errors within Shadow DOM.
- Allow module to be imported by non-browser JavaScript.
- Add
tabbable.isFocusable
andtabbable.isTabbable
functions.
- Add
[contenteditable]
elements.
- Add
<audio>
and<video>
elements withcontrols
attributes. - Only consider radio buttons tabbable if they are the
checked
on in their group, or if none in their group arechecked
.
- Fix bug causing SVG elements to precede elements they should follow in the tab order in IE.
- Ensure
querySelectorAll
receives a string argument.
- Fix crash when you call
tabbable(document)
(passing thedocument
element).
- Add
includeContainer
option.
- Allows operation against elements that reside within iframes, by inspecting the element to determine its correct parent
document
(rather than relying on the globaldocument
object).
- Ensure stable sort of
tabindex
ed elements even in browsers that have an unstableArray.prototype.sort
.
- Check
tabindex
attribute (viagetAttribute
), in addition tonode.tabIndex
, to fix handling of SVGs withtabindex="-1"
in IE.
- Children of
visibility: hidden
elements that themselves havevisibility: visible
are considered tabbable.
- Fix IE9 compatibility.
- Further improvements to caching.
- Fix overaggressive caching that would prevent
tabbable
from knowing an element's children had changed.
- Fix handling of
<a>
elements withtabindex="0"
.
- Initial release.