Accessibility · Senior · Question 5 of 75
A modal sets aria-hidden="true" on #app, but focus is still inside #app. What happens?
- 1The browser moves focus into the modal automatically for you
- 2Nothing changes, because
aria-hiddendoesn't affect focused nodes - 3Focus lands in hidden content; Chrome may even block the attribute
Show the answer
Correct answer: Focus lands in hidden content; Chrome may even block the attribute
Explanation
Move focus first. Chrome warns and ignores aria-hidden when a descendant holds focus. Prefer inert, which removes focus as well.