-
Notifications
You must be signed in to change notification settings - Fork 119
Description
Thanks @andy-blum @stefcameron.
I see a warning appearing in the Google Chrome console when using
aria-hidden.To reproduce the problem, go to https://focus-trap.github.io/focus-trap/#isolate-subtree-heading and click on the "activate outer trap (aria-hidden)" button. The following message appears in the Google Chrome console:
Blocked aria-hidden on an element because its descendant retained focus. The focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.
Element with focus: <button#activate-isolate-subtree-aria>
Ancestor with aria-hidden:<p aria-hidden="true">…</p>I don't know exactly how to solve this problem, but perhaps you should first move the focus to the trap element and then add
aria-hiddenattribute (rather than doing both actions at the same time).