Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ally.maintain.tabFocus throws error when pressing Tab inside a dialog without focusable elements #178

Open
rafa11rodrigues opened this issue Feb 8, 2021 · 0 comments

Comments

@rafa11rodrigues
Copy link

rafa11rodrigues commented Feb 8, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant