ally.js
ally.js copied to clipboard
ally.maintain.tabFocus throws error when pressing Tab inside a dialog without focusable elements
ally.maintain.tabFocus works pretty well when my dialog has a button, or a input, but if my dialog has only text, console shows error when I press Tab or Shift+Tab.
Here's the error:
Uncaught TypeError: is/active-element requires valid options.context
at ht (ally.js:51)
at xt (ally.js:101)
at HTMLHtmlElement.?alt+?shift+tab (ally.js:4870)
at ally.js:4825
at Array.forEach (<anonymous>)
at HTMLHtmlElement.a (ally.js:4820)
ht @ ally.js:51
xt @ ally.js:101
?alt+?shift+tab @ ally.js:4870
(anonymous) @ ally.js:4825
a @ ally.js:4820
Here is my setup:
const dialog = document.getElementById('dialog');
let nonFocusableNodes = ally.maintain.disabled({
filter: dialog,
});
let tabKeyHandled = ally.maintain.tabFocus({
context: dialog,
});
allyJS version: 1.4.1